Class NotificationServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.notification.NotificationServiceImpl
- All Implemented Interfaces:
NotificationService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.common.cache.Cache<String, NotificationConfigTO> protected ConfigurationServiceprotected ContentServiceprotected EmailMessageQueueToprotected SecurityServiceprotected ServicesConfigprotected StudioConfigurationFields inherited from interface org.craftercms.studio.api.v2.service.notification.NotificationService
COMPLETE_DELETE, COMPLETE_GO_LIVE, COMPLETE_REJECT, COMPLETE_SCHEDULE_GO_LIVE, COMPLETE_SUBMIT_TO_GO_LIVE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<ContentItemTO> convertPathsToContent(String site, List<String> listOfPaths) protected NotificationConfigTOgetNotificationConfig(String site) @Valid StringgetNotificationMessage(String site, NotificationMessageType type, String key, org.apache.commons.lang3.tuple.Pair<String, Object>... params) Gets and process notification messagevoidinit()protected voidloadCannedMessages(org.dom4j.Element completedMessages, Map<String, List<MessageTO>> messageContainer) protected NotificationConfigTOloadConfig(String site) protected voidloadEmailTemplates(org.dom4j.Element emailTemplates, Map<String, EmailMessageTemplateTO> messageContainer) protected voidloadGenericMessage(org.dom4j.Element emailTemplates, Map<String, String> messageContainer) voidnotify(String site, List<String> toUsers, String key, org.apache.commons.lang3.tuple.Pair<String, Object>... params) Process and Sends a generic email.protected voidvoidnotifyApprovesContentSubmission(String site, List<String> usersToNotify, List<String> itemsSubmitted, String submitter, ZonedDateTime scheduleDate, boolean isADelete, String submissionComments) Send to all given users a notification of content that need to be review.voidnotifyContentApproval(String site, String submitter, List<String> itemsSubmitted, String approver, ZonedDateTime scheduleDate) Sends Notification when content was approve.voidnotifyContentRejection(String site, List<String> submittedByList, List<String> rejectedItems, String rejectionReason, String userThatRejects) Notifies to the submitter that the content has been rejected.voidnotifyDeploymentError(String name, Throwable throwable) Sends a email to configure emails when a deployment had failvoidnotifyDeploymentError(String site, Throwable throwable, List<PublishRequest> filesUnableToPublish) Sends a email to configure emails when a deployment had failvoidnotifyRepositoryMergeConflict(String site, List<String> filesUnableToMerge) Send email to admin that repository has merged conflictprotected Stringprotected voidvoidsetCache(com.google.common.cache.Cache<String, NotificationConfigTO> cache) voidsetConfigurationService(ConfigurationService configurationService) voidsetContentService(ContentService contentService) voidsetEmailMessages(EmailMessageQueueTo emailMessages) voidsetSecurityService(SecurityService securityService) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetStudioConfiguration(StudioConfiguration studioConfiguration)
-
Field Details
-
contentService
-
emailMessages
-
servicesConfig
-
securityService
-
studioConfiguration
-
configurationService
-
cache
-
-
Constructor Details
-
NotificationServiceImpl
public NotificationServiceImpl()
-
-
Method Details
-
init
public void init() -
notifyDeploymentError
@Valid public void notifyDeploymentError(String site, Throwable throwable, List<PublishRequest> filesUnableToPublish) Description copied from interface:NotificationServiceSends a email to configure emails when a deployment had fail
- Specified by:
notifyDeploymentErrorin interfaceNotificationService- Parameters:
site- Name of the site which the deployment fail.throwable- Throwable error which break the deployment. (Can be null)filesUnableToPublish- List of files that where unable to publish (can be null)
-
notifyDeploymentError
Description copied from interface:NotificationServiceSends a email to configure emails when a deployment had fail
- Specified by:
notifyDeploymentErrorin interfaceNotificationService- Parameters:
name- Name of the site which the deployment fail.throwable- Throwable error which break the deployment. (Can be null)
-
notifyContentApproval
@Valid public void notifyContentApproval(String site, String submitter, List<String> itemsSubmitted, String approver, ZonedDateTime scheduleDate) Description copied from interface:NotificationServiceSends Notification when content was approve.- Specified by:
notifyContentApprovalin interfaceNotificationService- Parameters:
site- Site of the Content.submitter- User that submit the content to approval.itemsSubmitted- List of Item paths that where approve (can be null)approver- User that approve the content.scheduleDate- scheduled date
-
getNotificationMessage
@Valid public @Valid String getNotificationMessage(String site, NotificationMessageType type, String key, org.apache.commons.lang3.tuple.Pair<String, Object>... params) Description copied from interface:NotificationServiceGets and process notification message- Specified by:
getNotificationMessagein interfaceNotificationService- Parameters:
site- Site of the Content.type- Type of the message wanted.key- key of the message wantedparams- parameters of the message this params will be used to process the message string.- Returns:
the message in the given locale and processed with the given variables.
If message not found either by key/locale it will return a default string)
-
notifyApprovesContentSubmission
@Valid public void notifyApprovesContentSubmission(String site, List<String> usersToNotify, List<String> itemsSubmitted, String submitter, ZonedDateTime scheduleDate, boolean isADelete, String submissionComments) Description copied from interface:NotificationServiceSend to all given users a notification of content that need to be review.- Specified by:
notifyApprovesContentSubmissionin interfaceNotificationService- Parameters:
site- Site of the Content.usersToNotify- List of users (username) to be notified.itemsSubmitted- List of Item paths that where approve (can be null)submitter- User (username) that is submitting the content.scheduleDate- When the content should go live (null if now (or as soon is approved)).isADelete- Is this submission a delete one.submissionComments- submission comments
-
notify
@Valid public void notify(String site, List<String> toUsers, String key, org.apache.commons.lang3.tuple.Pair<String, Object>... params) Description copied from interface:NotificationServiceProcess and Sends a generic email.- Specified by:
notifyin interfaceNotificationService- Parameters:
site- Site of the Content.toUsers- List of recipients.key- key of the message wantedparams- parameters of the message this params will be used to process the message string.
-
notify
-
notifyContentRejection
@Valid public void notifyContentRejection(String site, List<String> submittedByList, List<String> rejectedItems, String rejectionReason, String userThatRejects) Description copied from interface:NotificationServiceNotifies to the submitter that the content has been rejected.- Specified by:
notifyContentRejectionin interfaceNotificationService- Parameters:
site- Site of the Content.submittedByList- List of users that submitted the rejected content.rejectedItems- Items that where rejectedrejectionReason- why the content was rejected.userThatRejects- User that is rejecting the content.
-
loadConfig
-
loadGenericMessage
-
loadEmailTemplates
protected void loadEmailTemplates(org.dom4j.Element emailTemplates, Map<String, EmailMessageTemplateTO> messageContainer) -
loadCannedMessages
-
getNotificationConfig
-
sendEmail
-
processMessage
-
convertPathsToContent
-
notifyRepositoryMergeConflict
Description copied from interface:NotificationServiceSend email to admin that repository has merged conflict- Specified by:
notifyRepositoryMergeConflictin interfaceNotificationService- Parameters:
site- site with merge conflictfilesUnableToMerge- files unable to merge
-
getConfigPath
-
getTemplateTimezone
-
setContentService
-
setEmailMessages
-
setServicesConfig
-
setSecurityService
-
setStudioConfiguration
-
setConfigurationService
-
setCache
-