示例#1
0
        public override void Execute()
        {
            base.Execute();

            try
            {
                ReleaseRunner.IdentifyAndRemoveOldExtractionResults(Activator.RepositoryLocator, new PopupChecksUI("Checking Release Logs", true), _extractionConfiguration);
            }
            catch (Exception e)
            {
                ShowException("Error checking for stale extraction logs", e);
            }

            try
            {
                WordDataReleaseFileGenerator generator = new WordDataReleaseFileGenerator(_extractionConfiguration, Activator.RepositoryLocator.DataExportRepository);

                //null means leave word file on screen and dont save
                generator.GenerateWordFile(null);
            }
            catch (Exception e)
            {
                ExceptionViewer.Show(e);
            }
        }
示例#2
0
        public override void Execute()
        {
            base.Execute();

            try
            {
                ReleaseRunner.IdentifyAndRemoveOldExtractionResults(BasicActivator.RepositoryLocator, new AcceptAllCheckNotifier(), _extractionConfiguration);
            }
            catch (Exception e)
            {
                ShowException("Error checking for stale extraction logs", e);
            }

            try
            {
                WordDataReleaseFileGenerator generator = new WordDataReleaseFileGenerator(_extractionConfiguration, BasicActivator.RepositoryLocator.DataExportRepository);

                //null means leave word file on screen and dont save
                generator.GenerateWordFile(null);
            }
            catch (Exception e)
            {
                BasicActivator.ShowException("Failed to generate release document", e);
            }
        }
        public void Test_WordDataReleaseFileGenerator_Normal()
        {
            var report = new WordDataReleaseFileGenerator(_configuration, _configuration.DataExportRepository);

            var filename = Path.Combine(TestContext.CurrentContext.WorkDirectory, "release.doc");

            report.GenerateWordFile(filename);

            Assert.IsTrue(File.Exists(filename));
        }
示例#4
0
        protected virtual void ReleaseAllExtractionConfigurations(Dictionary <IExtractionConfiguration, List <ReleasePotential> > toRelease, StreamWriter sw, Dictionary <IExtractionConfiguration, ReleaseEnvironmentPotential> environments, bool isPatch)
        {
            //for each configuration, all the release potentials can be released
            foreach (KeyValuePair <IExtractionConfiguration, List <ReleasePotential> > kvp in toRelease)
            {
                var extractionIdentifier = kvp.Key.Name + "_" + kvp.Key.ID;

                //create a root folder with the same name as the configuration (e.g. controls folder then next loop iteration a cases folder - with a different cohort)
                DirectoryInfo configurationSubDirectory = ReleaseAudit.ReleaseFolder.CreateSubdirectory(extractionIdentifier);

                AuditExtractionConfigurationDetails(sw, configurationSubDirectory, kvp, extractionIdentifier);

                AuditDirectoryCreation(configurationSubDirectory.Name, sw, 0);

                var customDataFolder = ReleaseCustomData(kvp, configurationSubDirectory);
                if (customDataFolder != null)
                {
                    AuditDirectoryCreation(customDataFolder.FullName, sw, 1);
                }

                var otherDataFolder = ReleaseMasterData(kvp, configurationSubDirectory);
                if (otherDataFolder != null)
                {
                    AuditDirectoryCreation(otherDataFolder.FullName, sw, 1);
                }

                var metadataFolder = ReleaseMetadata(kvp, configurationSubDirectory);
                if (metadataFolder != null)
                {
                    AuditDirectoryCreation(metadataFolder.FullName, sw, 1);
                }

                //generate release document
                var generator = new WordDataReleaseFileGenerator(kvp.Key, _repository);
                generator.GenerateWordFile(Path.Combine(configurationSubDirectory.FullName, "ReleaseDocument_" + extractionIdentifier + ".docx"));
                AuditFileCreation("ReleaseDocument_" + extractionIdentifier + ".docx", sw, 1);

                //only copy across directories that are explicitly validated with a ReleasePotential
                foreach (ReleasePotential rp in kvp.Value)
                {
                    if (rp.ExtractDirectory == null)
                    {
                        continue;
                    }

                    DirectoryInfo rpDirectory = configurationSubDirectory.CreateSubdirectory(rp.ExtractDirectory.Name);
                    AuditDirectoryCreation(rpDirectory.Name, sw, 1);

                    CutTreeRecursive(rp.ExtractDirectory, rpDirectory, sw, 2);
                    AuditProperRelease(rp, environments[kvp.Key], rpDirectory, isPatch);
                }

                ConfigurationsReleased.Add(kvp.Key);
            }
        }
示例#5
0
        public override void Execute()
        {
            base.Execute();

            try
            {
                WordDataReleaseFileGenerator generator = new WordDataReleaseFileGenerator(_extractionConfiguration, Activator.RepositoryLocator.DataExportRepository);

                //null means leave word file on screen and dont save
                generator.GenerateWordFile(null);
            }
            catch (Exception e)
            {
                ExceptionViewer.Show(e);
            }
        }