|
static String | processMacrosForWeb (IContact contact, String message) |
|
static String | processMacros (IContact contact, String message) |
|
static String | processLinks (IContact contact, String message) |
|
static String | processLinks (String email, String message) |
|
static String | cleanLinks (String message) |
|
static String | processLiveLinks (String email, String message) |
|
static String | processLiveRefs (String email, String message) |
|
static String | cleanLiveLinks (String message) |
|
static String | cleanLiveRefs (String message) |
|
static String | processImgWidth (String message) |
|
static String | processUser (IContact contact, String message) |
|
static String | processUser (String email, String name, String message) |
|
static String | processUser (MailRecipient recipient, String message) |
|
static String | toAbsolute (String text) |
|
◆ cleanLinks()
static String org.turro.mail.message.MailUtils.cleanLinks |
( |
String |
message | ) |
|
|
static |
◆ cleanLiveLinks()
static String org.turro.mail.message.MailUtils.cleanLiveLinks |
( |
String |
message | ) |
|
|
static |
Definition at line 119 of file elephant-mail/src/main/java/org/turro/mail/message/MailUtils.java.
120 if(message.contains(
"{livelink")) {
121 Pattern pat = Pattern.compile(LIVE_LINK_PATTERN);
122 Matcher mat = pat.matcher(message);
123 StringBuffer result =
new StringBuffer();
126 if(mat.groupCount() > 1 && !Strings.isBlank(mat.group(1)) && !Strings.isBlank(mat.group(2))) {
127 mat.appendReplacement(result,
"<a href='" + mat.group(2) +
"'>" + mat.group(1) +
"</a>");
129 }
catch (Exception ex) {
130 WebLoggers.severe(MailUtils.class).exception(ex).log();
133 mat.appendTail(result);
134 return result.toString();
◆ cleanLiveRefs()
static String org.turro.mail.message.MailUtils.cleanLiveRefs |
( |
String |
message | ) |
|
|
static |
Definition at line 139 of file elephant-mail/src/main/java/org/turro/mail/message/MailUtils.java.
140 if(message.contains(
"{liveref")) {
141 Pattern pat = Pattern.compile(LIVE_REF_PATTERN);
142 Matcher mat = pat.matcher(message);
143 StringBuffer result =
new StringBuffer();
146 if(mat.groupCount() > 0 && !Strings.isBlank(mat.group(1))) {
147 mat.appendReplacement(result, mat.group(1));
149 }
catch (Exception ex) {
150 WebLoggers.severe(MailUtils.class).exception(ex).log();
153 mat.appendTail(result);
154 return result.toString();
◆ processImgWidth()
static String org.turro.mail.message.MailUtils.processImgWidth |
( |
String |
message | ) |
|
|
static |
◆ processLinks() [1/2]
static String org.turro.mail.message.MailUtils.processLinks |
( |
IContact |
contact, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processLinks() [2/2]
static String org.turro.mail.message.MailUtils.processLinks |
( |
String |
email, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processLiveLinks()
static String org.turro.mail.message.MailUtils.processLiveLinks |
( |
String |
email, |
|
|
String |
message |
|
) |
| |
|
static |
Definition at line 75 of file elephant-mail/src/main/java/org/turro/mail/message/MailUtils.java.
76 if(message.contains(
"{livelink")) {
77 Pattern pat = Pattern.compile(LIVE_LINK_PATTERN);
78 Matcher mat = pat.matcher(message);
79 StringBuffer result =
new StringBuffer();
82 if(mat.groupCount() > 1 && !Strings.isBlank(mat.group(1)) && !Strings.isBlank(mat.group(2))) {
83 String server = ElephantContext.getServerUrl(
"http") +
"?" +
84 Actions.createActionFromElephant(email, URLDecoder.decode(mat.group(2), StandardCharsets.UTF_8.name()));
85 mat.appendReplacement(result,
"<a href=\"" + server +
"\">" + mat.group(1) +
"</a>");
87 }
catch (Exception ex) {
88 WebLoggers.severe(MailUtils.class).exception(ex).log();
91 mat.appendTail(result);
92 return result.toString();
◆ processLiveRefs()
static String org.turro.mail.message.MailUtils.processLiveRefs |
( |
String |
email, |
|
|
String |
message |
|
) |
| |
|
static |
Definition at line 97 of file elephant-mail/src/main/java/org/turro/mail/message/MailUtils.java.
98 if(message.contains(
"{liveref")) {
99 Pattern pat = Pattern.compile(LIVE_REF_PATTERN);
100 Matcher mat = pat.matcher(message);
101 StringBuffer result =
new StringBuffer();
104 if(mat.groupCount() > 0 && !Strings.isBlank(mat.group(1))) {
105 String server = ElephantContext.getServerUrl(
"http") +
"?" +
106 Actions.createActionFromElephant(email, URLDecoder.decode(mat.group(1), StandardCharsets.UTF_8.name()));
107 mat.appendReplacement(result, server);
109 }
catch (Exception ex) {
110 WebLoggers.severe(MailUtils.class).exception(ex).log();
113 mat.appendTail(result);
114 return result.toString();
◆ processMacros()
static String org.turro.mail.message.MailUtils.processMacros |
( |
IContact |
contact, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processMacrosForWeb()
static String org.turro.mail.message.MailUtils.processMacrosForWeb |
( |
IContact |
contact, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processUser() [1/3]
static String org.turro.mail.message.MailUtils.processUser |
( |
IContact |
contact, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processUser() [2/3]
static String org.turro.mail.message.MailUtils.processUser |
( |
MailRecipient |
recipient, |
|
|
String |
message |
|
) |
| |
|
static |
◆ processUser() [3/3]
static String org.turro.mail.message.MailUtils.processUser |
( |
String |
email, |
|
|
String |
name, |
|
|
String |
message |
|
) |
| |
|
static |
◆ toAbsolute()
static String org.turro.mail.message.MailUtils.toAbsolute |
( |
String |
text | ) |
|
|
static |
Definition at line 191 of file elephant-mail/src/main/java/org/turro/mail/message/MailUtils.java.
192 String serverBase = ElephantContext.getServerBase(
"http");
193 return text.replaceAll(
"href=\\'(?![a-z]+:)(\\/?)\\/?([^\\']*)\\'",
"href=\\'" + serverBase +
"$1$2\\'")
194 .replaceAll(
"src=\\'(?![a-z]+:)(\\/?)\\/?([^\\']*)\\'",
"src=\\'" + serverBase +
"$1$2\\'")
195 .replaceAll(
"href=\\\"(?![a-z]+:)(\\/?)\\/?([^\\\"]*)\\\"",
"href=\\\"" + serverBase +
"$1$2\\\"")
196 .replaceAll(
"src=\\\"(?![a-z]+:)(\\/?)\\/?([^\\\"]*)\\\"",
"src=\\\"" + serverBase +
"$1$2\\\"");
The documentation for this class was generated from the following file: