Пример #1
0
 public void ExportTaxonomyGroup(string groupName)
 {
     Console.WriteLine("Starting export of taxonomy group " + groupName);
     using (var context = new ClientContext(_urlToSite))
     {
         context.Credentials = _credentials;
         var outputDirectoryPath = Path.Combine(_rootPath, "export");
         Directory.CreateDirectory(outputDirectoryPath);
         var taxPersistanceProvider = new FilePersistanceProvider <ShTermGroup>(Path.Combine(outputDirectoryPath, groupName.ToLower().Replace(" ", "") + "taxonomy.json"));
         var taxonomyManager        = new TaxonomyManager();
         var groupConfig            = taxonomyManager.ExportTaxonomyGroupToConfig(context, groupName);
         if (groupConfig != null)
         {
             taxPersistanceProvider.Save(groupConfig);
             Console.WriteLine("Completed exported of taxonomy group " + groupName);
         }
     }
 }