Hello community,
Every once in a while we get new MultiTerm XML files to replace our Termbases with revised versions. Since this affects 19 termbases, I am eager to automate this process.
This means, I need to create a new termbase, use the previous version as template, and import the new XML. Rinse and repeat for 19 files.
Unfortunately, I cannot find the portion in the API documentation thatdescribes how to actually tell *which" XML to import.
This is what I have so far:
var multi = new Sdl.MultiTerm.TMO.Interop.Application();var repo = multi.LocalRepository;repo.Connect("Administrator", "");repo.Termbases.Add(pathToPreviousTBVersion,TbName,"ReferenceTB");var refTermBase = repo.Termbases[0];var xdt = $"C:\\temp\\temp.xdt";if(File.Exists(xdt)) File.Delete(xdt);refTermBase.Definition.Save(xdt);
repo.Termbases.New(newTbName, newTbDescription, xdt, pathToSaveNewTB);var xmlFile = pathToMultiTermXml;var newTermBase= repo.Termbases[1];var impDefs = newTermBase.ImportDefinitions;var impDef = impDefs["Default import definition"];impDef.ProcessImport(MtTaskType.mtScript);
From what I understand, MtTaskType.mtScript means "import without GUI", i.e. exactly what I need. Unfortunately, there is no method or property to tell the API the path to the XML that shall be imported. What am I missing?
Cheers,
Andreas
Translate