mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Prevent unwanted audit entries appearing when updating the records
This commit is contained in:
@@ -362,47 +362,53 @@ public class UpdateRecordScheduleGet extends AbstractWebScript implements Record
|
|||||||
{
|
{
|
||||||
int recordCount = 0;
|
int recordCount = 0;
|
||||||
|
|
||||||
behaviourFilter.disableBehaviour(recordFolder);
|
behaviourFilter.disableBehaviour(ASPECT_FILE_PLAN_COMPONENT);
|
||||||
if (logger.isDebugEnabled())
|
try
|
||||||
{
|
{
|
||||||
logger.info("Checking folder: " + recordFolder);
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.info("Checking folder: " + recordFolder);
|
||||||
|
}
|
||||||
|
recordCount = AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Integer>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Integer doWork() throws Exception
|
||||||
|
{
|
||||||
|
DispositionSchedule schedule = dispositionService.getDispositionSchedule(recordFolder);
|
||||||
|
int innerRecordCount = 0;
|
||||||
|
if (schedule != null && schedule.isRecordLevelDisposition())
|
||||||
|
{
|
||||||
|
|
||||||
|
List<NodeRef> records = recordService.getRecords(recordFolder);
|
||||||
|
for (NodeRef record : records)
|
||||||
|
{
|
||||||
|
if (!nodeService.hasAspect(record, ASPECT_DISPOSITION_LIFECYCLE))
|
||||||
|
{
|
||||||
|
if (recordFolder.equals(nodeService.getPrimaryParent(record).getParentRef()))
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.info("updating record: " + record);
|
||||||
|
}
|
||||||
|
|
||||||
|
// update record disposition information
|
||||||
|
dispositionService.updateNextDispositionAction(record, schedule);
|
||||||
|
innerRecordCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return innerRecordCount;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
nodeService.addAspect(recordFolder, ASPECT_DISPOSITION_PROCESSED, null);
|
||||||
}
|
}
|
||||||
recordCount = AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Integer>()
|
finally
|
||||||
{
|
{
|
||||||
@Override
|
behaviourFilter.enableBehaviour(ASPECT_FILE_PLAN_COMPONENT);
|
||||||
public Integer doWork() throws Exception
|
}
|
||||||
{
|
|
||||||
DispositionSchedule schedule = dispositionService.getDispositionSchedule(recordFolder);
|
|
||||||
int innerRecordCount = 0;
|
|
||||||
if (schedule != null && schedule.isRecordLevelDisposition())
|
|
||||||
{
|
|
||||||
|
|
||||||
List<NodeRef> records = recordService.getRecords(recordFolder);
|
|
||||||
for (NodeRef record : records)
|
|
||||||
{
|
|
||||||
if (!nodeService.hasAspect(record, ASPECT_DISPOSITION_LIFECYCLE))
|
|
||||||
{
|
|
||||||
if (recordFolder.equals(nodeService.getPrimaryParent(record).getParentRef()))
|
|
||||||
{
|
|
||||||
if (logger.isDebugEnabled())
|
|
||||||
{
|
|
||||||
logger.info("updating record: " + record);
|
|
||||||
}
|
|
||||||
behaviourFilter.disableBehaviour(record);
|
|
||||||
dispositionService.updateNextDispositionAction(record, schedule);
|
|
||||||
innerRecordCount++;
|
|
||||||
behaviourFilter.enableBehaviour(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return innerRecordCount;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
nodeService.addAspect(recordFolder, ASPECT_DISPOSITION_PROCESSED, null);
|
|
||||||
behaviourFilter.enableBehaviour(recordFolder);
|
|
||||||
return recordCount;
|
return recordCount;
|
||||||
}
|
}
|
||||||
}, false, true);
|
}, false, true);
|
||||||
|
Reference in New Issue
Block a user