From 4d4bef068ae51a828794af77b51cfa0cfb302405 Mon Sep 17 00:00:00 2001 From: Jan Vonka Date: Thu, 14 Jul 2016 10:21:38 +0000 Subject: [PATCH] Merged 5.2.N (5.2.1) to HEAD (5.2) 128779 jvonka: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 128777 jvonka: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 128747 jvonka: MNT-16538: compensate for Media Management bean override (commentService) - MNT-16446: Edit Comment permission git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@128781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/forum/CommentServiceImpl.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/source/java/org/alfresco/repo/forum/CommentServiceImpl.java b/source/java/org/alfresco/repo/forum/CommentServiceImpl.java index 37277d8c09..35bd0c6d8a 100644 --- a/source/java/org/alfresco/repo/forum/CommentServiceImpl.java +++ b/source/java/org/alfresco/repo/forum/CommentServiceImpl.java @@ -155,6 +155,48 @@ public class CommentServiceImpl extends AbstractLifecycleBean @Override protected void onBootstrap(ApplicationEvent event) { + // belts-and-braces (in case of broken spring-bean override) + ApplicationContext ctx = getApplicationContext(); + if (ctx != null) + { + if (this.nodeService == null) + { + this.nodeService = (NodeService)ctx.getBean("NodeService"); + } + if (this.contentService == null) + { + this.contentService = (ContentService)ctx.getBean("ContentService"); + } + if (this.siteService == null) + { + this.siteService = (SiteService)ctx.getBean("SiteService"); + } + if (this.activityService == null) + { + this.activityService = (ActivityService)ctx.getBean("activityService"); + } + if (this.cannedQueryRegistry == null) + { + this.cannedQueryRegistry = (NamedObjectRegistry>)ctx.getBean("commentsCannedQueryRegistry"); + } + if (this.policyComponent == null) + { + this.policyComponent = (PolicyComponent)ctx.getBean("policyComponent"); + } + if (this.behaviourFilter == null) + { + this.behaviourFilter = (BehaviourFilter)ctx.getBean("policyBehaviourFilter"); + } + if (this.permissionService == null) + { + this.permissionService = (PermissionService)ctx.getBean("PermissionService"); + } + if (this.lockService == null) + { + this.lockService = (LockService)ctx.getBean("LockService"); + } + } + this.policyComponent.bindClassBehaviour( NodeServicePolicies.BeforeUpdateNodePolicy.QNAME, ForumModel.TYPE_POST,