Merged BRANCHES/DEV/V3.4-BUG-FIX to HEAD

Fix build failures related to Audit 
   28511: Fix build - VersionMigratorTest testMigrateVersionWithAssocs - defaultOnCreateVersion() being called for each aspect as default policy was bound as a service.
   28505: Test failure - AbstractVersionServiceImpl was not running defaultOnCreateVersion() as AccessAuditor provided a policy to listen to events.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28517 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2011-06-22 13:34:02 +00:00
parent d9a3f5d504
commit 9bc6e57f22
3 changed files with 64 additions and 29 deletions

View File

@@ -179,33 +179,28 @@ public abstract class AbstractVersionServiceImpl
Map<String, Serializable> versionProperties,
PolicyScope nodeDetails)
{
Collection<OnCreateVersionPolicy> policies = this.onCreateVersionDelegate.getList(classRef);
if (policies.size() == 0)
{
// Call the default implementation
defaultOnCreateVersion(
classRef,
nodeRef,
versionProperties,
nodeDetails);
}
else
{
// Call the policy definitions
for (VersionServicePolicies.OnCreateVersionPolicy policy : policies)
{
policy.onCreateVersion(
classRef,
nodeRef,
versionProperties,
nodeDetails);
}
}
// Call the default implementation
defaultOnCreateVersion(
classRef,
nodeRef,
versionProperties,
nodeDetails);
// Call the policy definitions
Collection<OnCreateVersionPolicy> policies = this.onCreateVersionDelegate.getList(classRef);
for (VersionServicePolicies.OnCreateVersionPolicy policy : policies)
{
policy.onCreateVersion(
classRef,
nodeRef,
versionProperties,
nodeDetails);
}
}
/**
* Default implementation of the on create version policy. Called if no behaviour is registered for the
* policy for the specified type.
* Default implementation of the on create version policy.
* Override if you wish to supply your own policy.
*
* @param nodeRef
* @param versionProperties