Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

92529: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      92463: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         92370: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.5)
            92314: Merged DEV to V4.1-BUG-FIX (4.1.10)
               92170 : MNT-2118 : Share inconsistencies when displaying locked files with tags
                  - Ignore working copies at search for tags
               92132 : MNT-2118 : Share inconsistencies when displaying locked files with tags
                  - Restore number of tag at check out
               92146 : MNT-2118 : Share inconsistencies when displaying locked files with tags
                  - Test failure fixed


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94888 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 11:52:55 +00:00
parent 662349a137
commit 1d30c027ad
2 changed files with 18 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ import org.alfresco.query.EmptyPagingResults;
import org.alfresco.query.PagingRequest; import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults; import org.alfresco.query.PagingResults;
import org.alfresco.repo.audit.AuditComponent; import org.alfresco.repo.audit.AuditComponent;
import org.alfresco.repo.coci.CheckOutCheckInServicePolicies;
import org.alfresco.repo.copy.CopyServicePolicies; import org.alfresco.repo.copy.CopyServicePolicies;
import org.alfresco.repo.copy.CopyServicePolicies.BeforeCopyPolicy; import org.alfresco.repo.copy.CopyServicePolicies.BeforeCopyPolicy;
import org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy; import org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy;
@@ -238,6 +239,11 @@ public class TaggingServiceImpl implements TaggingService,
OnCopyCompletePolicy.QNAME, OnCopyCompletePolicy.QNAME,
ContentModel.ASPECT_TAGGABLE, ContentModel.ASPECT_TAGGABLE,
new JavaBehaviour(this, "onCopyComplete", NotificationFrequency.EVERY_EVENT)); new JavaBehaviour(this, "onCopyComplete", NotificationFrequency.EVERY_EVENT));
this.policyComponent.bindClassBehaviour(
CheckOutCheckInServicePolicies.OnCheckOut.QNAME,
ContentModel.ASPECT_TAGGABLE,
new JavaBehaviour(this, "afterCheckOut", NotificationFrequency.EVERY_EVENT));
} }
/** /**
@@ -298,7 +304,7 @@ public class TaggingServiceImpl implements TaggingService,
public void beforeDeleteNode(NodeRef nodeRef) public void beforeDeleteNode(NodeRef nodeRef)
{ {
if (this.nodeService.exists(nodeRef) == true && if (this.nodeService.exists(nodeRef) == true &&
this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGGABLE) == true) this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGGABLE) == true && !this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
{ {
updateAllScopeTags(nodeRef, Boolean.FALSE); updateAllScopeTags(nodeRef, Boolean.FALSE);
} }
@@ -1508,4 +1514,13 @@ public class TaggingServiceImpl implements TaggingService,
{ {
} }
public void afterCheckOut(NodeRef workingCopy)
{
if (this.nodeService.exists(workingCopy) == true && this.nodeService.hasAspect(workingCopy, ContentModel.ASPECT_TAGGABLE) == true
&& this.nodeService.hasAspect(workingCopy, ContentModel.ASPECT_WORKING_COPY))
{
updateAllScopeTags(workingCopy, Boolean.FALSE);
}
}
} }

View File

@@ -1175,8 +1175,8 @@ public class TaggingServiceImplTest extends TestCase
assertEquals(3, taggingService.findTagScope(testData.container1).getTags().size()); assertEquals(3, taggingService.findTagScope(testData.container1).getTags().size());
assertEquals(0, taggingService.findTagScope(testData.container2).getTags().size()); assertEquals(0, taggingService.findTagScope(testData.container2).getTags().size());
assertEquals(3, taggingService.findTagScope(testData.container1).getTag("foo1").getCount()); assertEquals(2, taggingService.findTagScope(testData.container1).getTag("foo1").getCount());
assertEquals(2, taggingService.findTagScope(testData.container1).getTag("foo2").getCount()); assertEquals(1, taggingService.findTagScope(testData.container1).getTag("foo2").getCount());
assertEquals(1, taggingService.findTagScope(testData.container1).getTag("foo3").getCount()); assertEquals(1, taggingService.findTagScope(testData.container1).getTag("foo3").getCount());
assertEquals(1, nodeService.getChildAssocs(testData.container1).size()); assertEquals(1, nodeService.getChildAssocs(testData.container1).size());