|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.alert.AlertBuilder
public class AlertBuilder
Field Summary | |
---|---|
protected Member |
author
|
protected Data |
data
|
protected String |
domain
|
protected boolean |
isAuthorRecipient
|
protected static Thread |
lastThread
|
protected Alert.Level |
level
|
protected String |
name
|
protected String |
propPrefix
|
Fields inherited from interface com.jalios.jcms.alert.AlertConstants |
---|
HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, TEXT_MARKUP, WIKI_MARKUP |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
AlertBuilder(Alert.Level level,
String domain,
String name)
|
|
AlertBuilder(Alert.Level level,
String domain,
String name,
Data data)
|
|
AlertBuilder(Alert.Level level,
String domain,
String name,
Data data,
Member author)
|
|
AlertBuilder(Alert.Level level,
String domain,
String name,
Data data,
Member author,
boolean isAuthorRecipient)
|
Method Summary | |
---|---|
protected void |
addParams(Member recipient,
Map<String,String> paramMap,
String markup)
This method is called to add parameters to the map used to format the properties. |
boolean |
canBeSaved()
|
Map<String,Object> |
getContext()
|
protected String |
getDataLink(Data data,
Member recipient)
Returns the HTML link for the given data (with an absolute URL). |
protected String |
getDataRepresentation(Data data,
String markup,
Member recipient)
Returns a representation of the given data suitable for the given markup. |
protected String |
getDataText(Data data,
Member recipient)
Returns the textual representation for the given data. |
String |
getDescription(Member recipient)
|
protected String |
getDescriptionPropName()
|
protected String |
getHtmlAbstract(Member recipient)
Returns an HTML representation of the abstract of the data (only if data instanceof Publication). |
protected Map<String,String> |
getHtmlPropParamMap(Member recipient)
|
String |
getMessage(Member mbr)
|
String |
getMessageMarkup()
|
String |
getShortDescription(Member recipient)
|
protected String |
getShortDescriptionPropName()
|
protected Map<String,String> |
getTextPropParamMap(Member recipient)
|
String |
getTitle(Member recipient)
|
protected String |
getTitlePropName()
|
protected String |
glp(Member recipient,
String prop,
Map<String,String> paramMap)
|
boolean |
isRecipient(Member mbr)
|
void |
sendAlert(Collection<Member> recipientCollection)
|
void |
sendAlert(Member recipient)
Sends the alert to the given recipient. |
void |
sendAlertInCurrentThread(Collection<Member> recipientCollection)
|
static void |
waitForSending()
A convenient method for unit test to wait for the ending of the sending thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Alert.Level level
protected String domain
protected String name
protected Member author
protected Data data
protected boolean isAuthorRecipient
protected String propPrefix
protected static Thread lastThread
Constructor Detail |
---|
public AlertBuilder(Alert.Level level, String domain, String name)
public AlertBuilder(Alert.Level level, String domain, String name, Data data)
public AlertBuilder(Alert.Level level, String domain, String name, Data data, Member author)
public AlertBuilder(Alert.Level level, String domain, String name, Data data, Member author, boolean isAuthorRecipient)
level
- the alert's leveldomain
- the alert's domainname
- the alert's namedata
- the alert's dataauthor
- the alert's authorisAuthorRecipient
- if false the alert won't be sent to the alert's authorMethod Detail |
---|
public boolean isRecipient(Member mbr)
public String getTitle(Member recipient)
public String getShortDescription(Member recipient)
public String getDescription(Member recipient)
public String getMessage(Member mbr)
public String getMessageMarkup()
public boolean canBeSaved()
public Map<String,Object> getContext()
protected String getTitlePropName()
protected String getShortDescriptionPropName()
protected String getDescriptionPropName()
protected String glp(Member recipient, String prop, Map<String,String> paramMap)
protected void addParams(Member recipient, Map<String,String> paramMap, String markup)
recipient
- the recipientparamMap
- the paramMapmarkup
- the markup used (i.e. TEXT_MARKUP or HTML_MARKUP)protected String getDataRepresentation(Data data, String markup, Member recipient)
data
- the datamarkup
- the markuprecipient
- the recipient (for localisation)
protected String getDataLink(Data data, Member recipient)
data
- the datarecipient
- the recipient (for localisation)
protected String getDataText(Data data, Member recipient)
data
- the datarecipient
- the recipient (for localisation)
protected String getHtmlAbstract(Member recipient)
recipient
- the recipient (for localisation)
protected Map<String,String> getTextPropParamMap(Member recipient)
protected Map<String,String> getHtmlPropParamMap(Member recipient)
public void sendAlert(Collection<Member> recipientCollection)
public void sendAlertInCurrentThread(Collection<Member> recipientCollection)
public static void waitForSending()
public void sendAlert(Member recipient)
recipient
- the recipient
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |