public SectionParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
        {
            ContainsLocationData = false;
            Logger      = logger;
            FileInfo    = fileInfo;
            SourceFile  = FileInfo.OriginalFile_Path;
            SectionName = Path.GetFileNameWithoutExtension(FileInfo.File_Name);

            List <string> sectionStrings = new List <string>();

            if (SectionName.Contains("_"))
            {
                sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            else if (SectionName.Contains("_"))
            {
                sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            if (!sectionStrings.Any())
            {
                sectionStrings.Add(SectionName);
            }

            List <string> sectionStringsUpper = new List <string>();
            string        temp = string.Empty;

            foreach (string s in sectionStrings)
            {
                sectionStringsUpper.Add(s.First().ToString().ToUpper() + s.Substring(1));
            }

            IsPreservation     = isPreservation;
            PreservationPrefix = preservationPrefix;
            ParserVersion      = version;

            MainTableName = string.Join("", sectionStringsUpper);
            if (isPreservation)
            {
                MainTableName = PreservationPrefix + "_" + MainTableName;
            }
            DisplaySectionName = string.Join(" ", sectionStringsUpper);

            LoadHtml();
            ProcessHTML();
        }
 public AboutMeParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
     : base(logger, fileInfo, isPreservation, preservationPrefix, version)
 {
     if (isPreservation)
     {
         List <PreservationQuery> pq = new List <PreservationQuery>();
         pq.Add(new PreservationQuery()
         {
             PreservationTableName = MainTableName,
             QueryText             = string.Format(
                 @"SELECT 
                         (CASE WHEN a.[AboutMe] IS NULL THEN 'true' ELSE 'false' END) as [MissingInCurrent],
                         p.[AboutMe] as [P_AboutMe], 
                         a.[AboutMe],
                         (case when LTRIM(RTRIM(p.[AboutMe])) <> LTRIM(RTRIM(a.[AboutMe])) THEN 'true' ELSE 'false' END) AS [AboutMe_Changed],
                         a.[File]     
                     FROM {0} p 
                     LEFT JOIN {1} a ON a.[AboutMe] = p.[AboutMe]", MainTableName, MainTableName.Replace(preservationPrefix + "_", ""))
         });
         PreservationQueries = pq;
     }
 }
 public VideosParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
     : base(logger, fileInfo, isPreservation, preservationPrefix, version)
 {
 }
 public NcmecReportsParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
     : base(logger, fileInfo, isPreservation, preservationPrefix, version)
 {
     throw new MissingTestDataException(DisplaySectionName);
 }
        internal void CommentsParse(ExtractFileInfo fileInfo)
        {
            CommentsParser sectionParser = new CommentsParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void DirectStoriesParse(ExtractFileInfo fileInfo)
        {
            DirectStoriesParser sectionParser = new DirectStoriesParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void VanityChangesParse(ExtractFileInfo fileInfo)
        {
            VanityChangesParser sectionParser = new VanityChangesParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void AccountStatusHistoryParse(ExtractFileInfo fileInfo)
        {
            AccountStatusHistoryParser sectionParser = new AccountStatusHistoryParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void PopularBlockParse(ExtractFileInfo fileInfo)
        {
            PopularBlockParser sectionParser = new PopularBlockParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void ProfilePictureParse(ExtractFileInfo fileInfo)
        {
            ProfilePictureParser sectionParser = new ProfilePictureParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        // addded for unified messages
        internal void UnifiedMessagesParse(ExtractFileInfo fileInfo)
        {
            UnifiedMessagesParser sectionParser = new UnifiedMessagesParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void LiveVideosParse(ExtractFileInfo fileInfo)
        {
            LiveVideosParser sectionParser = new LiveVideosParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void IncomingFollowRequestsParse(ExtractFileInfo fileInfo)
        {
            IncomingFollowRequestsParser sectionParser = new IncomingFollowRequestsParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
        internal void FollowingParse(ExtractFileInfo fileInfo)
        {
            FollowingParser sectionParser = new FollowingParser(_log, fileInfo, IsPreservation, DatabasePreservationNoPrefix, Version);

            WriteTables(sectionParser);
        }
Ejemplo n.º 15
0
 public AccountStatusHistoryParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
     : base(logger, fileInfo, isPreservation, preservationPrefix, version)
 {
 }