public void OnCompleted(WebDeleteProcessorContext context, IList <Series> series) { if (series.Count > 0) { Platform.Log(LogLevel.Info, "Logging history.."); DateTime now = Platform.Time; using (IUpdateContext ctx = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush)) { IStudyHistoryEntityBroker broker = ctx.GetBroker <IStudyHistoryEntityBroker>(); StudyHistoryUpdateColumns columns = new StudyHistoryUpdateColumns(); columns.InsertTime = Platform.Time; columns.StudyHistoryTypeEnum = StudyHistoryTypeEnum.SeriesDeleted; columns.StudyStorageKey = context.StorageLocation.Key; columns.DestStudyStorageKey = context.StorageLocation.Key; columns.StudyData = XmlUtils.SerializeAsXmlDoc(_studyInfo); SeriesDeletionChangeLog changeLog = new SeriesDeletionChangeLog(); changeLog.TimeStamp = now; changeLog.Reason = context.Reason; changeLog.UserId = context.UserId; changeLog.UserName = context.UserName; changeLog.Series = CollectionUtils.Map(series, delegate(Series ser) { ServerEntityAttributeProvider seriesWrapper = new ServerEntityAttributeProvider(ser); return(new SeriesInformation(seriesWrapper)); }); columns.ChangeDescription = XmlUtils.SerializeAsXmlDoc(changeLog); StudyHistory history = broker.Insert(columns); if (history != null) { ctx.Commit(); } } } }
public void OnCompleted(WebDeleteProcessorContext context, IList<Series> series) { if (series.Count > 0) { Platform.Log(LogLevel.Info, "Logging history.."); DateTime now = Platform.Time; using(IUpdateContext ctx = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush)) { IStudyHistoryEntityBroker broker = ctx.GetBroker<IStudyHistoryEntityBroker>(); StudyHistoryUpdateColumns columns = new StudyHistoryUpdateColumns(); columns.InsertTime = Platform.Time; columns.StudyHistoryTypeEnum = StudyHistoryTypeEnum.SeriesDeleted; columns.StudyStorageKey = context.StorageLocation.Key; columns.DestStudyStorageKey = context.StorageLocation.Key; columns.StudyData = XmlUtils.SerializeAsXmlDoc(_studyInfo); SeriesDeletionChangeLog changeLog = new SeriesDeletionChangeLog(); changeLog.TimeStamp = now; changeLog.Reason = context.Reason; changeLog.UserId = context.UserId; changeLog.UserName = context.UserName; changeLog.Series = CollectionUtils.Map(series, delegate(Series ser) { ServerEntityAttributeProvider seriesWrapper = new ServerEntityAttributeProvider(ser); return new SeriesInformation(seriesWrapper); }); columns.ChangeDescription = XmlUtils.SerializeAsXmlDoc(changeLog); StudyHistory history = broker.Insert(columns); if (history!=null) ctx.Commit(); } } }
private void OnSeriesDeleted(Series seriesUid) { EnsureWebDeleteExtensionsLoaded(); foreach (IWebDeleteProcessorExtension extension in _extensions) { try { WebDeleteProcessorContext context = new WebDeleteProcessorContext(this, Level, StorageLocation, _reason, _userId, _userName); extension.OnSeriesDeleted(context, seriesUid); } catch (Exception ex) { Platform.Log(LogLevel.Error, ex, "Error occurred in the extension but was ignored"); } } }
public void OnSeriesDeleted(WebDeleteProcessorContext context, Series _series) { }
public void OnSeriesDeleting(WebDeleteProcessorContext context, Series series) { _studyInfo = StudyInformation.CreateFrom(context.StorageLocation.Study); }