Skip to content

Commit

Permalink
NXP-32719: Disable automatic versioning when (un)attaching rule
Browse files Browse the repository at this point in the history
  • Loading branch information
guirenard committed Jul 3, 2024
1 parent b799086 commit 356ea68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ public boolean isRetentionExpired() {
}

protected void save(CoreSession session) {
document.putContextData(VersioningService.DISABLE_AUTOMATIC_VERSIONING, true);
document.putContextData(DublinCoreListener.DISABLE_DUBLINCORE_LISTENER, true);
document.putContextData(NotificationConstants.DISABLE_NOTIFICATION_SERVICE, true);
document.putContextData(NXAuditEventsService.DISABLE_AUDIT_LOGGER, true);
document.putContextData(VersioningService.DISABLE_AUTO_CHECKOUT, true);
document.putContextData(RetentionConstants.RETENTION_CHECKER_LISTENER_IGNORE, true);
session.saveDocument(document);
document.putContextData(VersioningService.DISABLE_AUTOMATIC_VERSIONING, null);
document.putContextData(DublinCoreListener.DISABLE_DUBLINCORE_LISTENER, null);
document.putContextData(NotificationConstants.DISABLE_NOTIFICATION_SERVICE, null);
document.putContextData(NXAuditEventsService.DISABLE_AUDIT_LOGGER, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public DocumentModel unattachRule(DocumentModel document, CoreSession session) {
record.unsetRule(session);
session.unsetRetainUntil(document.getRef());
document.removeFacet(RetentionConstants.RECORD_FACET);
document.putContextData(VersioningService.DISABLE_AUTOMATIC_VERSIONING, true);
document.putContextData(DublinCoreListener.DISABLE_DUBLINCORE_LISTENER, true);
document.putContextData(NotificationConstants.DISABLE_NOTIFICATION_SERVICE, true);
document.putContextData(NXAuditEventsService.DISABLE_AUDIT_LOGGER, true);
Expand Down

0 comments on commit 356ea68

Please sign in to comment.