/// <exception cref="Exception">Root schema does not include a BIE schema.</exception> public ImporterContext(ICctsRepository cctsRepository, string rootSchemaPath) { RootSchemaPath = rootSchemaPath; RootSchemaFileName = Path.GetFileName(rootSchemaPath); string inputDirectory = Path.GetDirectoryName(rootSchemaPath) + @"\"; foreach (string schemaLocation in GetIncludedSchemaLocations(rootSchemaPath)) { if (schemaLocation.StartsWith("BusinessInformationEntity")) { BIESchemaPath = inputDirectory + schemaLocation; } else if (schemaLocation.StartsWith("BusinessDataType")) { BDTSchemaPath = inputDirectory + schemaLocation; } } if (BDTSchemaPath == null) { throw new Exception("Root schema does not include a BDT schema."); } if (BIESchemaPath == null) { throw new Exception("Root schema does not include a BIE schema."); } CDTLibrary = cctsRepository.GetCdtLibraries().ElementAt(0); CCLibrary = cctsRepository.GetCcLibraries().ElementAt(0); BDTLibrary = cctsRepository.GetBdtLibraries().ElementAt(0); BIELibrary = cctsRepository.GetBieLibraries().ElementAt(0); PRIMLibrary = cctsRepository.GetPrimLibraries().ElementAt(0); BLibrary = cctsRepository.GetBLibraries().ElementAt(0); }
public void AccessCctsRepositoryAndLoadNamesOfAllElements() { ICctsRepository cctsRepository = CctsRepositoryFactory.CreateCctsRepository(new TemporaryFileBasedRepository("C:/Temp/test.eap")); foreach (ICcLibrary ccLibrary in cctsRepository.GetCcLibraries()) { foreach (IAcc acc in ccLibrary.Accs) { Console.WriteLine(acc.Name); } } }
public void LoadCCLs(ICctsRepository repository) { foreach (ICcLibrary ccl in repository.GetCcLibraries()) { if (CCLs.ContainsKey(ccl.Name)) { EmptyCache(); throw new CacheException("The wizard encountered two CC libraries having identical names. Please make sure that all CC libraries within the model have unique names before proceeding with the wizard."); } CCLs.Add(ccl.Name, new cCCLibrary(ccl.Name, ccl.Id)); } if (CCLs.Count == 0) { throw new CacheException("The repository did not contain any CC libraries. Please make sure at least one CC library is present before proceeding with the wizard."); } }
public XsltGeneratorForm(ICctsRepository cctsRepository) { Model = new XsltGeneratorViewModel(); DataContext = this; CctsRepository = cctsRepository; InitializeComponent(); buttonImport.IsEnabled = false; Model.CcLibraries = new List <ICcLibrary>(CctsRepository.GetCcLibraries()); if (Model.CcLibraries.Count > 0) { ccLibraryComboBox.SelectedIndex = 0; } Model.BLibraries = new List <IBLibrary>(CctsRepository.GetBLibraries()); if (Model.BLibraries.Count > 0) { bLibraryComboBox.SelectedIndex = 0; } mappedSchemaFileSelector.FileNameChanged += MappedSchemaFileSelectorFileNameChanged; mappedSchemaFileSelector.FileName = " "; mappedSchemaFileSelector.FileName = ""; }