BExIS.IO.Transform.Output.OutputMetadataManager.IsValideAgainstSchema C# (CSharp) Метод

IsValideAgainstSchema() публичный статический Метод

public static IsValideAgainstSchema ( long datasetId, TransmissionType type, string mappingName ) : string
datasetId long
type TransmissionType
mappingName string
Результат string
        public static string IsValideAgainstSchema(long datasetId, TransmissionType type, string mappingName)
        {
            try
            {
                DatasetManager datasetManager = new DatasetManager();
                DatasetVersion datasetVersion = datasetManager.GetDatasetLatestVersion(datasetId);

                string mappingFileName = XmlDatasetHelper.GetTransmissionInformation(datasetVersion, type, mappingName);
                string pathMappingFile = Path.Combine(AppConfiguration.GetModuleWorkspacePath("DIM"), mappingFileName);

                XmlMapperManager xmlMapperManager = new XmlMapperManager(TransactionDirection.InternToExtern);
                xmlMapperManager.Load(pathMappingFile, "exporttest");

                XmlDocument tmp = GetConvertedMetadata(datasetId, type, mappingName, false);

                string path = Path.Combine(AppConfiguration.DataPath, "Temp", "System", "convertedMetadata.xml");

                if (FileHelper.FileExist(path))
                    FileHelper.Delete(path);

                FileHelper.CreateDicrectoriesIfNotExist(Path.GetDirectoryName(path));

                tmp.Save(path);
                XmlDocument metadataForImport = new XmlDocument();
                metadataForImport.Load(path);

                return xmlMapperManager.Validate(metadataForImport);
            }
            catch (Exception ex)
            {

                return ex.Message;
            }
        }