void PostUpdateDocument(DocumentInfo document, DocumentInfo oldDocument, bool updated) { if (updated) { if (checkPublishUpdated.Checked) { document.Publish(); } // safe remove old resources, if needed - need to do this before update! if (checkDeleteOldFiles.Checked) { if (oldDocument.Url != document.Url && !string.IsNullOrEmpty(oldDocument.Url)) { DocumentsDataProvider.Instance.DeleteDocumentResource( oldDocument, PortalId); } } // update URL history UrlHistory.StoreUrl(document.Url); // update document & URL tracking data DocumentsDataProvider.Instance.Update(document); DocumentsDataProvider.Instance.UpdateDocumentUrl( document, oldDocument.Url, PortalId, ModuleId ); } else { if (checkUnpublishSkipped.Checked) { // unpublish not updated documents & update them document.UnPublish(); DocumentsDataProvider.Instance.Update(document); } } }