mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge pull request #1399 from Alfresco/feature/RM-6882_RemoveDodAspectFromRejectedRecord
RM-6882 remove other rm specific aspects when rejecting a record
This commit is contained in:
@@ -27,8 +27,12 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.record;
|
package org.alfresco.module.org_alfresco_module_rm.record;
|
||||||
|
|
||||||
|
import static java.util.Arrays.asList;
|
||||||
|
|
||||||
|
import static org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model.DOD_URI;
|
||||||
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.appendIdentifierToName;
|
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.appendIdentifierToName;
|
||||||
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.generateRecordIdentifier;
|
import static org.alfresco.module.org_alfresco_module_rm.record.RecordUtils.generateRecordIdentifier;
|
||||||
|
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel.RMV_URI;
|
||||||
import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.FIRST_EVENT;
|
import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.FIRST_EVENT;
|
||||||
import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.TRANSACTION_COMMIT;
|
import static org.alfresco.repo.policy.Behaviour.NotificationFrequency.TRANSACTION_COMMIT;
|
||||||
import static org.alfresco.repo.policy.annotation.BehaviourKind.ASSOCIATION;
|
import static org.alfresco.repo.policy.annotation.BehaviourKind.ASSOCIATION;
|
||||||
@@ -1566,10 +1570,10 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// Note that when folder records are supported, we will need to recursively
|
// Note that when folder records are supported, we will need to recursively
|
||||||
// remove aspects from their descendants.
|
// remove aspects from their descendants.
|
||||||
final Set<QName> aspects = nodeService.getAspects(nodeRef);
|
final Set<QName> aspects = nodeService.getAspects(nodeRef);
|
||||||
|
final List<String> rmURIs = asList(RM_URI, DOD_URI, RM_CUSTOM_URI, RMV_URI);
|
||||||
for (QName aspect : aspects)
|
for (QName aspect : aspects)
|
||||||
{
|
{
|
||||||
if (RM_URI.equals(aspect.getNamespaceURI()) ||
|
if (rmURIs.contains(aspect.getNamespaceURI()))
|
||||||
RecordableVersionModel.RMV_URI.equals(aspect.getNamespaceURI()))
|
|
||||||
{
|
{
|
||||||
nodeService.removeAspect(nodeRef, aspect);
|
nodeService.removeAspect(nodeRef, aspect);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user