public ReExportArticleNlm() { //Resolve needed dependencies using (var scope = AutofacConfig.ServiceLocator.BeginLifetimeScope()) { _nlmExportService = scope.Resolve <INlmExportService>(); _searcher = scope.Resolve <IArticleSearchService>(); } }
private static void DeleteNlm(INlmExportService exportService, ArticleItem articleItem) { if (!exportService.DeleteNlm(articleItem)) { // NLM Delete failed SheerResponse.Alert("The deletion XML file could not be generated."); return; } SheerResponse.Alert("The article has been successfully exported for deletion."); }
public NlmLoggingDecorator(INlmExportService innerService, ILog logger, IDependencies _) { if (innerService == null) { throw new ArgumentNullException(nameof(innerService)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } _innerService = innerService; _logger = logger; this._ = _; }
public ViewNlmViewModel(INlmExportService exportService, Func <string, ISitecoreService> serviceFactory) { if (exportService == null) { throw new ArgumentNullException(nameof(exportService)); } if (serviceFactory == null) { throw new ArgumentNullException(nameof(serviceFactory)); } _exportService = exportService; _service = serviceFactory(Constants.MasterDb); _lazyArticleNlm = new Lazy <string>(GetArticleNlm); }
private static void ExportNlm(INlmExportService exportService, ArticleItem articleItem, PublicationType pubType) { // Generate NLM XML, and retrieve the validation result var result = exportService.ExportNlm(articleItem, ExportType.Manual, pubType); if (!result.ExportSuccessful) { // NLM Export failed SheerResponse.Alert( "The article did not pass NLM validation and has not been exported. Please check the fields and try again."); return; } SheerResponse.Alert("The article passed NLM validation and exported successfully."); }
public ItemsPublishingProcessor(ILog logger, Func <Database, ISitecoreService> serviceFactory, INlmExportService exportService, IFindItemScheduledPublishHistories publishHistory) { if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (serviceFactory == null) { throw new ArgumentNullException(nameof(serviceFactory)); } if (exportService == null) { throw new ArgumentNullException(nameof(exportService)); } if (publishHistory == null) { throw new ArgumentNullException(nameof(publishHistory)); } _logger = logger; _serviceFactory = serviceFactory; _exportService = exportService; _publishHistory = publishHistory; }