Ejemplo n.º 1
0
 protected override void ReadAttributeEvent(object sender, ReadElementEventArgs eventArgs)
 {
     if (Noark5TestHelper.IdentifiesJournalPostRegistration(eventArgs))
     {
         _archiveExtractionJournalPostCount++;
     }
 }
Ejemplo n.º 2
0
 protected override void ReadAttributeEvent(object sender, ReadElementEventArgs eventArgs)
 {
     if (Noark5TestHelper.IdentifiesJournalPostRegistration(eventArgs))
     {
         _journalPostAttributeIsFound = true;
     }
 }
Ejemplo n.º 3
0
 protected override void ReadAttributeEvent(object sender, ReadElementEventArgs eventArgs)
 {
     if (Noark5TestHelper.IdentifiesBaseRegistrationInRegistration(eventArgs))
     {
         _baseRegistrationAttributeIsFound = true;
     }
 }
 protected override void ReadElementValueEvent(object sender, ReadElementEventArgs eventArgs)
 {
     if (eventArgs.Path.Matches("opprettetDato", "registrering") &&
         Noark5TestHelper.TryParseArchiveDate(eventArgs.Value, out DateTime registrationCreatedTime))
     {
         _registrationCreationDates.Add(registrationCreatedTime);
     }
 }
        public ArchiveStartAndEndDateControl(Archive archive)
        {
            _registrationCreationDates = new SortedSet <DateTime>();

            _headPublicJournal  = Noark5TestHelper.GetJournalHead(ArkadeConstants.PublicJournalXmlFileName, archive);
            _headRunningJournal = Noark5TestHelper.GetJournalHead(ArkadeConstants.RunningJournalXmlFileName, archive);

            _periodSeparationIsSharp = Noark5TestHelper.PeriodSeparationIsSharp(archive);
        }
Ejemplo n.º 6
0
 protected override void ReadAttributeEvent(object sender, ReadElementEventArgs eventArgs)
 {
     if (Noark5TestHelper.IdentifiesJournalPostRegistration(eventArgs))
     {
         _currentJournalPost = new JournalPost {
             ArchivePartSystemId = _currentArchivePartSystemId
         }
     }
     ;
 }
Ejemplo n.º 7
0
        protected override void ReadAttributeEvent(object sender, ReadElementEventArgs eventArgs)
        {
            if (Noark5TestHelper.IdentifiesCasefolder(eventArgs))
            {
                int level = eventArgs.Path.GetSameElementSubLevel();
                AddFolderOnLevel(_currentArchivePart.CaseFoldersPerLevel, level);
            }

            if (Noark5TestHelper.IdentifiesMeetingFolder(eventArgs))
            {
                int level = eventArgs.Path.GetSameElementSubLevel();
                AddFolderOnLevel(_currentArchivePart.MeetingFoldersPerLevel, level);
            }
        }
Ejemplo n.º 8
0
        private int GetDocumentedNumberOfFolders()
        {
            addml addml = Noark5TestHelper.GetAddmlObject(ArkadeConstants.ArkivuttrekkXmlFileName, _archive);

            string numberOfFolders = addml.dataset[0].dataObjects.dataObject[0]
                                     .dataObjects.dataObject[0].properties.FirstOrDefault(
                p => p.name == "info").properties.Where(
                p => p.name == "numberOfOccurrences").FirstOrDefault(
                p => p.value.Equals("mappe")).properties.FirstOrDefault(
                p => p.name.Equals("value"))
                                     .value;

            return(int.Parse(numberOfFolders));
        }
Ejemplo n.º 9
0
        public NumberOfJournalPosts(Archive archive)
        {
            try
            {
                _publicJournalNumberOfJournalPosts =
                    GetPostCountFromJournal(ArkadeConstants.PublicJournalXmlFileName, archive);

                _runningJournalNumberOfJournalPosts =
                    GetPostCountFromJournal(ArkadeConstants.RunningJournalXmlFileName, archive);
            }
            catch (Exception)
            {
                _testResults.Add(new TestResult(ResultType.Error, Location.Archive,
                                                Noark5Messages.NumberOfJournalPostsMessage_CouldNotReadFromJournals));
            }

            _periodSeparationIsSharp = Noark5TestHelper.PeriodSeparationIsSharp(archive);
        }
Ejemplo n.º 10
0
        protected override void ReadElementValueEvent(object sender, ReadElementEventArgs eventArgs)
        {
            if (eventArgs.Path.Matches("systemID", "arkivdel"))
            {
                _currentArchivePart = new ArchivePart {
                    SystemId = eventArgs.Value
                };
                _archiveParts.Add(_currentArchivePart);
            }

            if (!eventArgs.Path.Matches("opprettetDato", "registrering"))
            {
                return;
            }

            if (Noark5TestHelper.TryParseArchiveDate(eventArgs.Value, out DateTime registrationCreatedTime))
            {
                _currentArchivePart.RegistrationCreationDates.Add(registrationCreatedTime);
            }
            else
            {
                _invalidRegistrationCreationDateCount++;
            }
        }