public static string GetDefaultTemplateDirectory( [CanBeNull] XmlVerificationOptions options) { if (options == null) { return(null); } string path = options.DefaultTemplateDirectoryPath; if (StringUtils.IsNullOrEmptyOrBlank(path)) { return(null); } string trimmedPath = path.Trim(); if (FileSystemUtils.HasInvalidPathChars(trimmedPath)) { throw new InvalidConfigurationException( $"Invalid default template directory path: {trimmedPath}"); } if (!Path.IsPathRooted(trimmedPath)) { throw new InvalidConfigurationException( $"Default template directory should be an absolute path: {trimmedPath}"); } return(trimmedPath); }
public static InvolvedObjectsMatchCriteria GetInvolvedObjectMatchCriteria( [NotNull] XmlVerificationOptions verificationOptions) { List <XmlInvolvedObjectsMatchCriterionIgnoredDatasets> ignoredDatasets = verificationOptions.Exceptions?.InvolvedObjectsMatchCriteria?.IgnoredDatasets; if (ignoredDatasets == null || ignoredDatasets.Count == 0) { return(null); } return(new InvolvedObjectsMatchCriteria(ignoredDatasets)); }
public static ShapeMatchCriterion GetDefaultShapeMatchCriterion( [CanBeNull] XmlVerificationOptions verificationOptions) { const ShapeMatchCriterion defaultValue = ShapeMatchCriterion.EqualEnvelope; if (verificationOptions == null) { return(defaultValue); } XmlExceptionConfiguration exceptions = verificationOptions.Exceptions; return(exceptions?.DefaultShapeMatchCriterion ?? defaultValue); }
public static ExceptionObjectStatus GetDefaultExceptionObjectStatus( [CanBeNull] XmlVerificationOptions verificationOptions) { const ExceptionObjectStatus defaultValue = ExceptionObjectStatus.Active; if (verificationOptions == null) { return(defaultValue); } XmlExceptionConfiguration exceptions = verificationOptions.Exceptions; return(exceptions?.DefaultExceptionObjectStatus ?? defaultValue); }
public static IWorkspace GetExceptionWorkspace( [NotNull] XmlVerificationOptions verificationOptions) { XmlExceptionConfiguration exceptions = verificationOptions.Exceptions; if (exceptions == null) { return(null); } string dataSource = exceptions.DataSource; return(StringUtils.IsNullOrEmptyOrBlank(dataSource) ? null : WorkspaceUtils.OpenWorkspace(dataSource.Trim())); }
public static string GetMxdDocumentName([CanBeNull] XmlVerificationOptions options) { if (options == null || StringUtils.IsNullOrEmptyOrBlank(options.MxdDocumentName)) { return("issues.mxd"); } string name = Assert.NotNull(options.MxdDocumentName).Trim(); if (FileSystemUtils.HasInvalidFileNameChars(name)) { throw new InvalidConfigurationException( $"Mxd document name is not a valid file name: {name}"); } return(name); }
public static string GetExportedExceptionsWorkspaceName( [CanBeNull] XmlVerificationOptions options) { if (options == null || StringUtils.IsNullOrEmptyOrBlank(options.ExceptionGdbName)) { return("exceptions"); } string name = Assert.NotNull(options.ExceptionGdbName).Trim(); if (FileSystemUtils.HasInvalidFileNameChars(name)) { throw new InvalidConfigurationException( $"Exception workspace name is not a valid file or directory name: {name}"); } return(name); }
public static string GetXmlReportFileName( [CanBeNull] XmlVerificationOptions options) { if (options == null || StringUtils.IsNullOrEmptyOrBlank(options.XmlReportName)) { return("verification.xml"); } string name = Assert.NotNull(options.XmlReportName).Trim(); if (FileSystemUtils.HasInvalidFileNameChars(name)) { throw new InvalidConfigurationException( $"Xml report name is not a valid file name: {name}"); } return(name); }
public static IEnumerable <XmlIssueMapOptions> GetIssueMapOptions( [CanBeNull] XmlVerificationOptions options, [CanBeNull] string defaultIssueMapTemplatePath, [NotNull] string defaultIssueMapFileName) { List <XmlIssueMapOptions> result = options?.IssueMaps ?? new List <XmlIssueMapOptions>(); if (result.Count == 0 && StringUtils.IsNotEmpty(defaultIssueMapTemplatePath)) { result.Add(new XmlIssueMapOptions { MxdFileName = defaultIssueMapFileName, TemplatePath = defaultIssueMapTemplatePath }); } return(result); }
GetSpecificationReportOptions( [CanBeNull] XmlVerificationOptions options, [CanBeNull] string defaultTemplatePath) { const string defaultReportFileName = "qualityspecification.html"; List <XmlSpecificationReportOptions> result = options?.SpecificationReports ?? new List <XmlSpecificationReportOptions>(); if (result.Count == 0 && !string.IsNullOrEmpty(defaultTemplatePath)) { result.Add(new XmlSpecificationReportOptions { ReportFileName = defaultReportFileName, TemplatePath = defaultTemplatePath }); } return(result); }
public static IEnumerable <XmlHtmlReportOptions> GetHtmlReportOptions( [CanBeNull] XmlVerificationOptions options, [CanBeNull] string defaultReportTemplatePath) { const string defaultReportFileName = "verification.html"; List <XmlHtmlReportOptions> result = options?.HtmlReports ?? new List <XmlHtmlReportOptions>(); if (result.Count == 0 && !string.IsNullOrEmpty(defaultReportTemplatePath)) { result.Add(new XmlHtmlReportOptions { ReportFileName = defaultReportFileName, TemplatePath = defaultReportTemplatePath }); } return(result); }
public static bool ExportExceptions([CanBeNull] XmlVerificationOptions options) { return(options?.Exceptions != null && options.Exceptions.ExportExceptions); }