Ejemplo n.º 1
0
 public ReExportArticleNlm()
 {
     //Resolve needed dependencies
     using (var scope = AutofacConfig.ServiceLocator.BeginLifetimeScope())
     {
         _nlmExportService = scope.Resolve <INlmExportService>();
         _searcher         = scope.Resolve <IArticleSearchService>();
     }
 }
Ejemplo n.º 2
0
        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.");
        }
Ejemplo n.º 3
0
 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._        = _;
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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.");
        }
Ejemplo n.º 6
0
 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;
 }