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
This commit is contained in:
Jan Vonka
2016-07-14 10:21:38 +00:00
parent 3a4df907df
commit 4d4bef068a

View File

@@ -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<CannedQueryFactory<? extends Object>>)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,