Example #1
0
 public XmlDataProcessor(
     XmlSettingsModel settings,
     IXmlDbUpdateLogService xmlDbUpdateLogService,
     IApplicationInfoRepository appInfoRepository,
     IXmlDbUpdateActionCorrecterService actionCorrecterService,
     IXmlDbUpdateHttpContextProcessor httpContextProcessor,
     HttpClient client,
     IServiceProvider provider
     )
     : base(settings)
 {
     _settings = settings;
     _xmlDbUpdateReplayService = new XmlDbUpdateNonMvcReplayService(
         QPContext.CurrentDbConnectionString,
         QPContext.DatabaseType,
         CommonHelpers.GetDbIdentityInsertOptions(settings.GenerateNewFieldIds, settings.GenerateNewContentIds),
         settings.UserId,
         settings.UseGuidSubstitution,
         xmlDbUpdateLogService,
         appInfoRepository,
         actionCorrecterService,
         httpContextProcessor,
         provider
         );
 }
Example #2
0
        internal static string Process(IList <string> filePathes, string configPath, XmlSettingsModel settingsTemp = null)
        {
            Program.Logger.Debug($"Begin parsing documents: {filePathes.ToJsonLog()} with next config: {configPath ?? "<default>"}");
            var orderedFilePathes = new List <string>();

            foreach (var path in filePathes)
            {
                if (!File.Exists(path) && !Directory.Exists(path))
                {
                    throw new FileNotFoundException($"Неправильно указан путь к файлам записанных действий: {path}");
                }

                if ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory)
                {
                    orderedFilePathes.AddRange(GetOrderedDirectoryFilePathes(path, configPath));
                }
                else
                {
                    orderedFilePathes.Add(path);
                }
            }

            Program.Logger.Info($"Total files readed from disk: {orderedFilePathes.Count}.");
            Program.Logger.Debug($"Documents will be processed in next order: {orderedFilePathes.ToJsonLog()}.");

            return(CombineMultipleDocumentsWithSameRoot(orderedFilePathes.Select(XDocument.Load).ToList()).ToNormalizedString(SaveOptions.DisableFormatting));
        }
Example #3
0
 public XmlDataProcessor(
     XmlSettingsModel settings,
     IXmlDbUpdateLogService xmlDbUpdateLogService,
     IApplicationInfoRepository appInfoRepository,
     IXmlDbUpdateActionCorrecterService actionCorrecterService,
     IXmlDbUpdateHttpContextProcessor httpContextProcessor)
     : base(settings)
 {
     _settings = settings;
     _xmlDbUpdateReplayService = new XmlDbUpdateNonMvcReplayService(
         QPContext.CurrentDbConnectionString,
         CommonHelpers.GetDbIdentityInsertOptions(settings.DisableFieldIdentity, settings.DisableContentIdentity),
         settings.UserId,
         settings.UseGuidSubstitution,
         xmlDbUpdateLogService,
         appInfoRepository,
         actionCorrecterService,
         httpContextProcessor);
 }