Package com.storedobject.core
Class MessageTemplate
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.MessageTemplate
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static MessageTemplate
create
(String name, TransactionManager tm) Create a template if it doesn't exist.createEmailAddress
(Object... parameters) createGeneratedBy
(Object... parameters) createMessage
(Person person, Object... parameters) Creates a message by replacing placeholders in the template with the provided parameters.createMessage
(Object... parameters) Deprecated.Class
<?> createProcessorLogic
(Object... parameters) createSenderGroup
(Object... parameters) createSubject
(Object... parameters) int
createValidity
(Object... parameters) static MessageTemplate
getCode()
int
static String
getDeliveryValue
(int value) static String[]
static MessageTemplate
Gets the unique index condition of this object.static void
static ObjectIterator
<MessageTemplate> listAll()
listAll
(int deliveryType) static List
<MessageTemplate> static List
<MessageTemplate> static boolean
notify
(String templateName, TransactionManager tm, Iterable<Person> persons, Object... messageParameters) Create and send messages to the given list of persons.send
(String templateName, TransactionControl tc, Person person, Object... messageParameters) send
(String templateName, TransactionControl tc, Iterable<Person> persons, Object... messageParameters) void
void
setContactType
(ContactType contactType) void
setContactType
(Id contactTypeId) void
setContactType
(BigDecimal idValue) void
setDelivery
(int delivery) void
setTemplate
(String template) toString()
String representation of the instance.void
This will be invoked by the system whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
MessageTemplate
public MessageTemplate()
-
-
Method Details
-
columns
-
indices
-
getUniqueCondition
Description copied from class:StoredObject
Gets the unique index condition of this object.- Overrides:
getUniqueCondition
in classStoredObject
- Returns:
- Unique index condition.
-
setCode
-
getCode
-
setContactType
-
setContactType
-
setContactType
-
getContactTypeId
-
getContactType
-
setTemplate
-
getTemplate
-
setDelivery
public void setDelivery(int delivery) -
getDelivery
-
getDeliveryValues
-
getDeliveryValue
-
getDeliveryValue
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
getFor
-
get
-
list
-
createMessage
Deprecated.Please usecreateMessage(Person, Object...)
instead.Creates a message by replacing placeholders in the template with the provided parameters. Placeholders should be specified in angle-brackets with an ordinal number of the parameter.- Parameters:
parameters
- The parameters used to replace placeholders in the template.- Returns:
- The generated message after replacing the placeholders with the parameters.
-
createMessage
Creates a message by replacing placeholders in the template with the provided parameters. Placeholders should be specified in angle-brackets with an ordinal number of the parameter. A special placeholder P in angle-brackets can be used for substituting the person's name and a placeholder TP in angle-brackets can be used for substituting person's name with salutation.- Parameters:
person
- The person to whom the message is addressed.parameters
- The parameters used to replace placeholders in the template.- Returns:
- The generated message after replacing the placeholders with the parameters.
-
createSubject
-
createEmailAddress
-
createProcessorLogic
-
createGeneratedBy
-
createSenderGroup
-
createValidity
-
listAll
-
listAll
-
listAll
-
listAll
-
send
-
send
-
notify
public static boolean notify(String templateName, TransactionManager tm, Iterable<Person> persons, Object... messageParameters) Create and send messages to the given list of persons.Note: If the template doesn't exist, a new template is created.
- Parameters:
templateName
- Template name.tm
- Transaction manager.persons
- List of persons.messageParameters
- Parameters for creating message from the associated template.- Returns:
- True if the message is successfully created for delivery.
-
create
Create a template if it doesn't exist.- Parameters:
tm
- Transaction manager- Returns:
- The template that is created or retrieved.
-
createMessage(Person, Object...)
instead.