public static List <string> WriteHtmlReports( [NotNull] QualitySpecification qualitySpecification, [NotNull] string directory, [NotNull] IssueStatistics issueStatistics, [NotNull] XmlVerificationReport verificationReport, [NotNull] string verificationReportFileName, [CanBeNull] string defaultReportTemplatePath = null, [CanBeNull] XmlVerificationOptions options = null, [CanBeNull] string issueGdbPath = null, [CanBeNull] IList <string> issueMapFilePaths = null, [CanBeNull] IList <string> qualitySpecificationReportFilePaths = null) { string defaultTemplateDirectory = VerificationOptionUtils.GetDefaultTemplateDirectory(options); var reportDefinitions = new List <HtmlReportDefinition>(); foreach (XmlHtmlReportOptions reportOptions in VerificationOptionUtils.GetHtmlReportOptions( options, defaultReportTemplatePath)) { HtmlReportDefinition reportDefinition = VerificationOptionUtils.GetReportDefinition(reportOptions, defaultReportTemplatePath, defaultTemplateDirectory); if (!File.Exists(reportDefinition.TemplatePath)) { _msg.WarnFormat("Template file does not exist: {0}", reportOptions.TemplatePath); continue; } reportDefinitions.Add(reportDefinition); } List <string> filePaths = reportDefinitions.Select(d => Path.Combine(directory, d.FileName)) .ToList(); foreach (HtmlReportDefinition reportDefinition in reportDefinitions) { WriteHtmlReport(qualitySpecification, directory, reportDefinition, issueStatistics, verificationReport, verificationReportFileName, issueGdbPath, issueMapFilePaths, filePaths, qualitySpecificationReportFilePaths); } return(filePaths); }
public static List <string> WriteQualitySpecificationReport( [NotNull] QualitySpecification qualitySpecification, [NotNull] string directory, [CanBeNull] string defaultTemplateFilePath, [CanBeNull] XmlVerificationOptions options) { string defaultTemplateDirectory = VerificationOptionUtils.GetDefaultTemplateDirectory(options); var reportFilePaths = new List <string>(); foreach (XmlSpecificationReportOptions reportOptions in VerificationOptionUtils.GetSpecificationReportOptions(options, defaultTemplateFilePath)) { SpecificationReportDefinition reportDefinition = VerificationOptionUtils.GetSpecificationReportDefinition(reportOptions, defaultTemplateFilePath, defaultTemplateDirectory); if (!File.Exists(reportDefinition.TemplatePath)) { _msg.WarnFormat("Template file does not exist: {0}", reportDefinition.TemplatePath); continue; } string filePath = Path.Combine(directory, reportDefinition.FileName); HtmlQualitySpecification model = SpecificationReportUtils.CreateHtmlQualitySpecification(qualitySpecification, reportDefinition); SpecificationReportUtils.RenderHtmlQualitySpecification( model, reportDefinition.TemplatePath, filePath); reportFilePaths.Add(filePath); } return(reportFilePaths); }