Class CommentSender
- java.lang.Object
-
- com.google.gerrit.server.mail.send.OutgoingEmail
-
- com.google.gerrit.server.mail.send.NotificationEmail
-
- com.google.gerrit.server.mail.send.ChangeEmail
-
- com.google.gerrit.server.mail.send.ReplyToChangeSender
-
- com.google.gerrit.server.mail.send.CommentSender
-
public class CommentSender extends ReplyToChangeSender
Send comments, after the author of them hit used Publish Comments in the UI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CommentSender.Factory
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.mail.send.ChangeEmail
authors, change, changeData, changeMessage, emailOnlyAuthors, patchSet, patchSetInfo, projectState, stars, timestamp
-
Fields inherited from class com.google.gerrit.server.mail.send.NotificationEmail
branch
-
Fields inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData, velocityContext
-
-
Constructor Summary
Constructors Constructor Description CommentSender(EmailArguments ea, CommentsUtil commentsUtil, org.eclipse.jgit.lib.Config cfg, Project.NameKey project, Change.Id id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
formatChange()
Format the message body by callingOutgoingEmail.appendText(String)
.void
formatFooter()
Format the message footer by callingOutgoingEmail.appendText(String)
.String
getInlineComments()
Deprecated.String
getInlineComments(int lines)
Deprecated.protected static String
getShortenedCommentMessage(Comment comment)
protected static String
getShortenedCommentMessage(String message)
boolean
hasInlineComments()
Deprecated.protected void
init()
Setup the message headers and envelope (TO, CC, BCC).void
setComments(List<Comment> comments)
void
setLabels(List<LabelVote> labels)
void
setPatchSetComment(String comment)
protected void
setupSoyContext()
protected boolean
supportsHtml()
Override this method to enable HTML in a subclass.-
Methods inherited from class com.google.gerrit.server.mail.send.ChangeEmail
add, bccStarredBy, ccAllApprovals, ccExistingReviewers, format, formatChangeDetail, formatCoverLetter, getAuthors, getChangeDetail, getChangeMessageThreadId, getChangeUrl, getCoverLetter, getIncludeDiff, getPatchList, getProjectOwners, getProjectState, getUnifiedDiff, getWatchers, isVisibleTo, newChangeData, rcptToAuthors, removeUsersThatIgnoredTheChange, setChangeMessage, setChangeMessage, setFrom, setPatchSet, setPatchSet, setupVelocityContext
-
Methods inherited from class com.google.gerrit.server.mail.send.NotificationEmail
add, getListId, getSshHost, includeWatchers, includeWatchers
-
Methods inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
add, add, add, add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, getFromLine, getGerritHost, getGerritUrl, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, removeHeader, removeUser, send, setAccountsToNotify, setHeader, setHeader, setNotify, setVHeader, shouldSendMessage, soyHtmlTemplate, soyTextTemplate, textTemplate, useHtml, velocify, velocifyFile
-
-
-
-
Constructor Detail
-
CommentSender
@Inject public CommentSender(EmailArguments ea, CommentsUtil commentsUtil, org.eclipse.jgit.lib.Config cfg, Project.NameKey project, Change.Id id) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
-
Method Detail
-
setComments
public void setComments(List<Comment> comments) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
setPatchSetComment
public void setPatchSetComment(String comment)
-
init
protected void init() throws EmailException
Description copied from class:ChangeEmail
Setup the message headers and envelope (TO, CC, BCC).- Overrides:
init
in classReplyToChangeSender
- Throws:
EmailException
- if an error occurred.
-
formatChange
public void formatChange() throws EmailException
Description copied from class:ChangeEmail
Format the message body by callingOutgoingEmail.appendText(String)
.- Specified by:
formatChange
in classChangeEmail
- Throws:
EmailException
-
formatFooter
public void formatFooter() throws EmailException
Description copied from class:ChangeEmail
Format the message footer by callingOutgoingEmail.appendText(String)
.- Overrides:
formatFooter
in classChangeEmail
- Throws:
EmailException
- if an error occurred.
-
hasInlineComments
@Deprecated public boolean hasInlineComments()
Deprecated.No longer used outside Velocity. Remove this method when VTL support is removed.
-
getInlineComments
@Deprecated public String getInlineComments()
Deprecated.No longer used outside Velocity. Remove this method when VTL support is removed.
-
getInlineComments
@Deprecated public String getInlineComments(int lines)
Deprecated.No longer used outside Velocity. Remove this method when VTL support is removed.
-
getShortenedCommentMessage
protected static String getShortenedCommentMessage(String message)
- Returns:
- a shortened version of the given comment's message. Will be shortened to 100 characters or the first line, or following the last period within the first 100 characters, whichever is shorter. If the message is shortened, an ellipsis is appended.
-
setupSoyContext
protected void setupSoyContext()
- Overrides:
setupSoyContext
in classChangeEmail
-
supportsHtml
protected boolean supportsHtml()
Description copied from class:OutgoingEmail
Override this method to enable HTML in a subclass.- Overrides:
supportsHtml
in classOutgoingEmail
-
-