|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.domain.ObservableDomainObject
com.arsdigita.kernel.ACSObject
com.arsdigita.notification.Notification
The Notification
class is used to create and send
messages via email to ACS users and groups. It acts as a wrapper
for a Message
which contains the subject, sender, body and
any attachments for the email. The recipient can be a User
or a Group
.
In the case of Group, the message can be sent to the group's email
address or expanded into a separate message for each member of the
group.
When using notifications for email alerts, applications often
need to wrap a special header and signature around the contained
Message object. This can be useful for including introductory
remarks and action links in the email body. The
setHeader
and setSignature
methods allow
you to do this without the need to create a separate Message for
the modified email.
For example, a bboard application might want to include a link so users can unsubscribe from the bboard. The alert processing code for the bboard can include this information in the alert as part of the signature:
notice.setMessage(msg); notice.setHeader ("Posted by: " + userName + "\n" + "Topic : " + topic + "\n" + "Subject : " + msg.getSubject() + "\n"); notice.setSignature ("To post a response, come back to the forum:\n" + forumURL + "Use the following URL to disable the alert that sent you this message:\n" forumUnsubscribeURL); notice.save();
Finally, notifications can be sent in "instant processing mode"
or as part of a Digest
. When sent as part of a digest all
notifications to the same recipient are collected into a single
email and sent at regular internal. For example, an hourly digest
might send a user all of their workflow task updates that have
changed in the past hour, rather a much larger number of individual
messages everytime an tasks changed.
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
|
static String |
CANCELLED
|
static String |
DIGEST_ID
|
static String |
EXPAND_GROUP
|
static String |
EXPUNGE_MSG_P
|
static String |
EXPUNGE_P
|
static String |
FAILED
|
static String |
FAILED_PARTIAL
|
static String |
FREQUENCY
|
static String |
FULFILL_DATE
|
static String |
GET_DIGEST_QUEUED_NOTIFICATIONS
|
static String |
GET_SIMPLE_QUEUED_NOTIFICATIONS
|
static String |
HEADER
|
static String |
MAX_RETRIES
|
static String |
MESSAGE_ID
|
static String |
NEXT_RUN
|
static String |
PARTY_FROM
|
static String |
PARTY_TO
|
static String |
PARTY_TO_ADDR
|
static String |
PENDING
|
static String |
QUEUED
|
static String |
REQUEST_DATE
|
static String |
REQUEST_ID
|
static String |
RETRY_COUNT
|
static String |
SENT
|
static String |
SEPARATOR
|
static String |
SIGNATURE
|
static String |
STATUS
|
static String |
SUBJECT
|
static String |
SUCCESS
|
Fields inherited from class com.arsdigita.kernel.ACSObject |
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId |
Constructor Summary | |
Notification()
Creates an empty Notification . |
|
Notification(BigDecimal id)
Retrieves an existing notification from the database using its BigDecimal id. |
|
Notification(Digest digest,
Party to,
Message msg)
Creates a notification by supplying the digest, the receiver, and an existing message to send. |
|
Notification(Digest digest,
Party to,
Party from,
String subject,
String body)
Creates a notification by supplying the digest, sender, receiver, subject, and body of the message. |
|
Notification(OID oid)
Retrieves an existing notification from the database using its OID. |
|
Notification(Party to,
Message msg)
Creates a notification by supplying the receiver and an existing message to send. |
|
Notification(Party to,
Party from,
String subject,
String body)
Creates a notification by supplying the sender, receiver, subject, and body of the message. |
Method Summary | |
protected void |
beforeSave()
|
void |
delete()
Deletes the notification. |
Digest |
getDigest()
Gets the digest associated with this notification. |
Boolean |
getExpandGroup()
Gets the group expansion flag for this notification. |
Date |
getFulfillDate()
Gets the fulfill date. |
Boolean |
getIsPermanent()
Gets the flag for whether this notification remains in the database after processing. |
Boolean |
getMessageDelete()
Gets the value of the MessageDelete flag if set. |
Date |
getRequestDate()
Gets the request date. |
String |
getStatus()
Get the status of this notification. |
void |
setDigest(Digest digest)
Sets the digest parameter for a notification. |
void |
setExpandGroup(Boolean expandGroup)
Sets the group expansion flag for this notification. |
void |
setHeader(String header)
Sets the header of the alert. |
void |
setIsPermanent(Boolean permanent)
Sets the flag for whether this notification remains in the database after processing. |
void |
setMessage(Message msg)
Sets the message containing the sender, subject, and body of this notification. |
void |
setMessageDelete(Boolean value)
Sets the flag for whether the underlying message should be deleted if and when this request is deleted. |
void |
setSignature(String signature)
Sets the signature of the notification. |
void |
setTo(Party to)
Sets the sender of the notification. |
Methods inherited from class com.arsdigita.kernel.ACSObject |
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID |
Methods inherited from class com.arsdigita.domain.ObservableDomainObject |
addObserver, getObservers |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String BASE_DATA_OBJECT_TYPE
public static final String DIGEST_ID
public static final String REQUEST_ID
public static final String MESSAGE_ID
public static final String PARTY_TO
public static final String PARTY_TO_ADDR
public static final String PARTY_FROM
public static final String RETRY_COUNT
public static final String SUCCESS
public static final String EXPAND_GROUP
public static final String REQUEST_DATE
public static final String FULFILL_DATE
public static final String STATUS
public static final String MAX_RETRIES
public static final String EXPUNGE_P
public static final String EXPUNGE_MSG_P
public static final String HEADER
public static final String SIGNATURE
public static final String SUBJECT
public static final String SEPARATOR
public static final String FREQUENCY
public static final String NEXT_RUN
public static final String PENDING
public static final String QUEUED
public static final String SENT
public static final String FAILED
public static final String FAILED_PARTIAL
public static final String CANCELLED
public static final String GET_SIMPLE_QUEUED_NOTIFICATIONS
public static final String GET_DIGEST_QUEUED_NOTIFICATIONS
Constructor Detail |
public Notification()
Notification
. This constructor
is invoked by all others to initialize the following default
parameters:
public Notification(Digest digest, Party to, Party from, String subject, String body)
digest
- the digest this notification is part ofto
- the party receiving the messagefrom
- the party sending the messagesubject
- the subject of the messagebody
- the body of the messagepublic Notification(Digest digest, Party to, Message msg)
digest
- notification belongs to this digestto
- the party recieving the messagemsg
- the message to sendpublic Notification(Party to, Party from, String subject, String body)
Message
object to store this information and sets the MessageDelete
flag to true
so the internal object is deleted when
the notification is deleted. Also sets the isPermanent flag to
false
so the notification will be deleted after
processing.
to
- the party receiving the messagefrom
- the party sending the messagesubject
- the subject of the messagebody
- the body of the messagepublic Notification(Party to, Message msg)
to
- the party recieving the messagemsg
- the message to sendpublic Notification(OID oid) throws DataObjectNotFoundException
oid
- the OID of the notificationpublic Notification(BigDecimal id) throws DataObjectNotFoundException
id
- the BigDecimal ID of the notificationMethod Detail |
public void setTo(Party to)
to
- the sender of the notificationpublic void setMessage(Message msg)
msg
- the message of this notificationpublic String getStatus()
public Boolean getIsPermanent()
true
if this notification remains in the
database after processing; false
otherwise.public void setIsPermanent(Boolean permanent)
permanent
- true
if this notification should
remain in the database after processingpublic Boolean getMessageDelete()
true
if the MessageDelete flag is set;
false
otherwise.public void setMessageDelete(Boolean value)
value
- true
if the underlying message should be
deleted when this request is deletedpublic Boolean getExpandGroup()
public void setExpandGroup(Boolean expandGroup)
public Digest getDigest() throws DataObjectNotFoundException
DataObjectNotFoundException
public void setDigest(Digest digest)
digest
- the digest this message belongs topublic Date getRequestDate()
public Date getFulfillDate()
public void setHeader(String header)
header
- the header of the alertpublic void setSignature(String signature)
signature
- the signature of the alertprotected void beforeSave()
beforeSave
in class ACSObject
public void delete()
delete
in class DomainObject
DataObject.delete()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |