Package fr.becpg.repo.notification.impl
Class NotificationRuleServiceImpl
java.lang.Object
fr.becpg.repo.notification.impl.NotificationRuleServiceImpl
- All Implemented Interfaces:
NotificationRuleService
@Service("notificationRuleService")
public class NotificationRuleServiceImpl
extends Object
implements NotificationRuleService
NotificationRuleServiceImpl class.
- Version:
- $Id: $Id
- Author:
- rabah
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AttributeExtractorServiceprivate org.alfresco.service.cmr.security.AuthorityServiceprivate BatchQueueServiceprivate static final StringConstantDATE_FIELD="dateField"private EntityDictionaryServiceprivate static final StringConstantDISPLAY_NAME="displayName"private static final StringConstantDISPLAY_PATH="displayPath"private org.alfresco.service.cmr.download.DownloadServiceprivate static final StringConstantENTITYV2_SUBTYPE="isEntityV2SubType"private ExportSearchServiceprivate org.alfresco.service.cmr.model.FileFolderServiceprivate static final StringConstantITEM="item"private static final StringConstantITEMS="items"private static final org.apache.commons.logging.LogConstantloggerprivate BeCPGMailServiceprivate org.alfresco.service.namespace.NamespaceServiceprivate static final StringConstantNODE="node"private static final StringConstantNODE_TYPE="type"private org.alfresco.service.cmr.repository.NodeServiceprivate static final StringConstantNOTIFICATION="notification"private org.alfresco.service.cmr.security.PermissionServiceprivate org.alfresco.service.cmr.security.PersonServiceprivate ReportTplServiceprivate RepoServiceprivate org.alfresco.service.cmr.repository.ScriptServiceprivate SearchRuleServiceprivate org.alfresco.service.ServiceRegistryprivate static final StringConstantTARGET_PATH="targetPath"private org.alfresco.service.transaction.TransactionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildBaseModel(NotificationRuleListDataItem notification, Map<String, Object> templateArgs) buildBaseModel.buildEntities(List<org.alfresco.service.cmr.repository.NodeRef> items, NotificationRuleListDataItem notification) buildEntities.private SearchRuleFilterbuildSearchFilter(NotificationRuleListDataItem notification) buildSearchFilter.buildTemplateArgs(NotificationRuleListDataItem notification, SearchRuleFilter filter) buildTemplateArgs.private Consumer<org.alfresco.service.cmr.repository.NodeRef> createMailSender(NotificationRuleListDataItem notification, Map<String, Object> templateArgs, Map<org.alfresco.service.cmr.repository.NodeRef, Object> entities, SearchRuleFilter searchFilter, SearchRuleResult searchResult) createMailSender.private booleanemailAdminNotificationDisabled(String username) emailAdminNotificationDisabled.private voidexecuteScript(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScript.private voidexecuteScriptAll(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptAll.private voidexecuteScriptEach(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptEach.private voidexecuteScriptIfExists(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptIfExists.extractAuthoritiesFromGroup(org.alfresco.service.cmr.repository.NodeRef authority) extractAuthoritiesFromGroup.private List<org.alfresco.service.cmr.repository.NodeRef> getAllNotificationRule.private voidinitializeNotification(NotificationRuleListDataItem notification) initializeNotification.private booleanisAllowed(NotificationRuleListDataItem notification) isAllowed.private booleanisEmptyResult(NotificationRuleListDataItem notification, SearchRuleResult result, SearchRuleFilter filter) isEmptyResult.private voidlogNoObjects(NotificationRuleListDataItem notification, SearchRuleFilter filter) logNoObjects.private voidprocessReportTemplates(NotificationRuleListDataItem notification, SearchRuleResult searchResult, Consumer<org.alfresco.service.cmr.repository.NodeRef> mailSender) processReportTemplates.private StringresolveDateFieldTitle(SearchRuleFilter filter, String userName) resolveDateFieldTitle.private voidsendMail(NotificationRuleListDataItem notification, Map<String, Object> templateArgs, SearchRuleFilter searchFilter, SearchRuleResult searchResult, org.alfresco.service.cmr.repository.NodeRef downloadNode, String userName, List<Object> userEntities) sendMail.voidsendNotifications.private booleanshouldSkip(NotificationRuleListDataItem notification) shouldSkip.private org.alfresco.service.cmr.repository.NodeRefwaitAndSaveDownload(org.alfresco.service.cmr.repository.NodeRef downloadNode, NotificationRuleListDataItem notification, org.alfresco.service.cmr.repository.NodeRef exportFolder, org.alfresco.service.cmr.repository.NodeRef reportTpl) waitAndSaveDownload.
-
Field Details
-
logger
private static final org.apache.commons.logging.Log loggerConstantlogger -
DATE_FIELD
ConstantDATE_FIELD="dateField"- See Also:
-
NODE_TYPE
ConstantNODE_TYPE="type"- See Also:
-
NODE
ConstantNODE="node"- See Also:
-
ITEM
ConstantITEM="item"- See Also:
-
ITEMS
ConstantITEMS="items"- See Also:
-
NOTIFICATION
ConstantNOTIFICATION="notification"- See Also:
-
TARGET_PATH
ConstantTARGET_PATH="targetPath"- See Also:
-
ENTITYV2_SUBTYPE
ConstantENTITYV2_SUBTYPE="isEntityV2SubType"- See Also:
-
DISPLAY_PATH
ConstantDISPLAY_PATH="displayPath"- See Also:
-
DISPLAY_NAME
ConstantDISPLAY_NAME="displayName"- See Also:
-
nodeService
@Autowired private org.alfresco.service.cmr.repository.NodeService nodeService -
mailService
-
serviceRegistry
@Autowired @Qualifier("ServiceRegistry") private org.alfresco.service.ServiceRegistry serviceRegistry -
namespaceService
@Autowired private org.alfresco.service.namespace.NamespaceService namespaceService -
authorityService
@Autowired private org.alfresco.service.cmr.security.AuthorityService authorityService -
permissionService
@Autowired private org.alfresco.service.cmr.security.PermissionService permissionService -
dictionaryService
-
searchRuleService
-
scriptService
@Autowired private org.alfresco.service.cmr.repository.ScriptService scriptService -
batchQueueService
-
alfrescoRepository
-
reportTplService
-
exportSearchService
-
downloadService
@Autowired private org.alfresco.service.cmr.download.DownloadService downloadService -
repoService
-
transactionService
@Autowired private org.alfresco.service.transaction.TransactionService transactionService -
fileFolderService
@Autowired private org.alfresco.service.cmr.model.FileFolderService fileFolderService -
personService
@Autowired private org.alfresco.service.cmr.security.PersonService personService -
attributeExtractorService
-
-
Constructor Details
-
NotificationRuleServiceImpl
public NotificationRuleServiceImpl()
-
-
Method Details
-
sendNotifications
public void sendNotifications()sendNotifications.
- Specified by:
sendNotificationsin interfaceNotificationRuleService
-
shouldSkip
shouldSkip.
- Parameters:
notification- aNotificationRuleListDataItemobject- Returns:
- a boolean
-
initializeNotification
initializeNotification.
- Parameters:
notification- aNotificationRuleListDataItemobject
-
buildSearchFilter
buildSearchFilter.
- Parameters:
notification- aNotificationRuleListDataItemobject- Returns:
- a
SearchRuleFilterobject
-
isEmptyResult
private boolean isEmptyResult(NotificationRuleListDataItem notification, SearchRuleResult result, SearchRuleFilter filter) isEmptyResult.
- Parameters:
notification- aNotificationRuleListDataItemobjectresult- aSearchRuleResultobjectfilter- aSearchRuleFilterobject- Returns:
- a boolean
-
logNoObjects
logNoObjects.
- Parameters:
notification- aNotificationRuleListDataItemobjectfilter- aSearchRuleFilterobject
-
buildTemplateArgs
private Map<String,Object> buildTemplateArgs(NotificationRuleListDataItem notification, SearchRuleFilter filter) buildTemplateArgs.
- Parameters:
notification- aNotificationRuleListDataItemobjectfilter- aSearchRuleFilterobject- Returns:
- a
Mapobject
-
buildEntities
private Map<org.alfresco.service.cmr.repository.NodeRef,Object> buildEntities(List<org.alfresco.service.cmr.repository.NodeRef> items, NotificationRuleListDataItem notification) buildEntities.
- Parameters:
items- aListobjectnotification- aNotificationRuleListDataItemobject- Returns:
- a
Mapobject
-
createMailSender
private Consumer<org.alfresco.service.cmr.repository.NodeRef> createMailSender(NotificationRuleListDataItem notification, Map<String, Object> templateArgs, Map<org.alfresco.service.cmr.repository.NodeRef, Object> entities, SearchRuleFilter searchFilter, SearchRuleResult searchResult) createMailSender.
- Parameters:
notification- aNotificationRuleListDataItemobjecttemplateArgs- aMapobjectentities- aMapobjectsearchFilter- aSearchRuleFilterobjectsearchResult- aSearchRuleResultobject- Returns:
- a
Consumerobject
-
sendMail
private void sendMail(NotificationRuleListDataItem notification, Map<String, Object> templateArgs, SearchRuleFilter searchFilter, SearchRuleResult searchResult, org.alfresco.service.cmr.repository.NodeRef downloadNode, String userName, List<Object> userEntities) sendMail.
- Parameters:
notification- aNotificationRuleListDataItemobjecttemplateArgs- aMapobjectsearchFilter- aSearchRuleFilterobjectsearchResult- aSearchRuleResultobjectdownloadNode- aNodeRefobjectuserName- aStringobjectuserEntities- aListobject
-
resolveDateFieldTitle
resolveDateFieldTitle.
- Parameters:
filter- aSearchRuleFilterobjectuserName- aStringobject- Returns:
- a
Stringobject
-
processReportTemplates
private void processReportTemplates(NotificationRuleListDataItem notification, SearchRuleResult searchResult, Consumer<org.alfresco.service.cmr.repository.NodeRef> mailSender) processReportTemplates.
- Parameters:
notification- aNotificationRuleListDataItemobjectsearchResult- aSearchRuleResultobjectmailSender- aConsumerobject
-
waitAndSaveDownload
private org.alfresco.service.cmr.repository.NodeRef waitAndSaveDownload(org.alfresco.service.cmr.repository.NodeRef downloadNode, NotificationRuleListDataItem notification, org.alfresco.service.cmr.repository.NodeRef exportFolder, org.alfresco.service.cmr.repository.NodeRef reportTpl) throws InterruptedException waitAndSaveDownload.
- Parameters:
downloadNode- aNodeRefobjectnotification- aNotificationRuleListDataItemobjectexportFolder- aNodeRefobjectreportTpl- aNodeRefobject- Returns:
- a
NodeRefobject - Throws:
InterruptedException- if any.
-
executeScriptIfExists
private void executeScriptIfExists(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptIfExists.
- Parameters:
notification- aNotificationRuleListDataItemobjectitems- aListobjecttemplateArgs- aMapobject
-
emailAdminNotificationDisabled
emailAdminNotificationDisabled.
- Parameters:
username- aStringobject- Returns:
- a boolean
-
executeScript
private void executeScript(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScript.
- Parameters:
notification- aNotificationRuleListDataItemobjectitems- aListobjecttemplateArgs- aMapobject
-
executeScriptEach
private void executeScriptEach(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptEach.
- Parameters:
notification- aNotificationRuleListDataItemobjectitems- aListobjecttemplateArgs- aMapobject
-
executeScriptAll
private void executeScriptAll(NotificationRuleListDataItem notification, List<org.alfresco.service.cmr.repository.NodeRef> items, Map<String, Object> templateArgs) executeScriptAll.
- Parameters:
notification- aNotificationRuleListDataItemobjectitems- aListobjecttemplateArgs- aMapobject
-
buildBaseModel
private Map<String,Object> buildBaseModel(NotificationRuleListDataItem notification, Map<String, Object> templateArgs) buildBaseModel.
- Parameters:
notification- aNotificationRuleListDataItemobjecttemplateArgs- aMapobject- Returns:
- a
Mapobject
-
extractAuthoritiesFromGroup
private Set<String> extractAuthoritiesFromGroup(org.alfresco.service.cmr.repository.NodeRef authority) extractAuthoritiesFromGroup.
- Parameters:
authority- aNodeRefobject- Returns:
- a
Setobject
-
getAllNotificationRule
getAllNotificationRule.
- Returns:
- a
Listobject
-
isAllowed
isAllowed.
- Parameters:
notification- aNotificationRuleListDataItemobject- Returns:
- a boolean
-