private void InstallTaxonomyFromSingleFile(ClientContext context, string pathToFile) { Log.Info("Starting installation of taxonomy based on " + pathToFile); var taxPersistanceProvider = new FilePersistanceProvider <ShTermGroup>(pathToFile); var taxonomyManager = new TaxonomyManager(taxPersistanceProvider.Load()); taxonomyManager.WriteTaxonomyToTermStore(context); }
public void SetupTaxonomy() { Console.WriteLine("Starting installation of term groups, term sets and terms"); using (var context = new ClientContext(_urlToSite)) { context.Credentials = _credentials; foreach (var file in Directory.GetFiles(ConfigurationDirectoryPath, "*taxonomy.json", SearchOption.AllDirectories)) { var taxPersistanceProvider = new FilePersistanceProvider <ShTermGroup>(file); var taxonomyManager = new TaxonomyManager(taxPersistanceProvider.Load()); taxonomyManager.WriteTaxonomyToTermStore(context); } } Console.WriteLine("Done installation of term groups, term sets and terms"); }