In the following tutorial it will be explained how to add a concept to a existing local termbase using MultiTerm SDK.
Sdl.MultiTerm.TMO.Interop vs Sdl.MultiTerm.Client.Api
MultiTerm Client is a newer API which might contain some improvements, this dll is private.
Tthis means it cannot be used in a plugin. When a plugin which uses a nonpublic api is used in Studio a error message appears when Studio is loaded. This client is recomanded to be used for standalone applications.
"Sdl.MultiTerm.Client.Api" is not a full replacement for the "Sdl.MultiTerm.TMO.Interop"
Sdl.MultiTerm.TMO.Interop is a public api, and it can be used in a plugin.
How to load a local Termbase and get the Entries using Sdl.MultiTerm.TMO.Interop
First of all you need to add a reference to MultiTerm Interop library.
var multiTermApplication = new Application();
var localRep = multiTermApplication.LocalRepository;
localRep.Connect("", "");
var termbases = localRep.Termbases;
var path = termbasePath;
termbases.Add(path, "", "");
var termbase = termbases[path];
var entries = termbase.Entries;
How to add a new entry to a local Termbase
To add new entries to a termbase, you first need to 'construct' the entry XML content to store in the termbase. Below you see a simplified example of what a MultiTerm XML entry can look like:
<conceptGrp>
<languageGrp>
<language type="English" lang="EN"/>
<termGrp>
<term>Sdl Community Wiki</term>
</termGrp>
</languageGrp>
</conceptGrp>
Example of concept content for 2 languages
<conceptGrp> <languageGrp> <language type="English" lang="en-US" /> <termGrp> <term>Step</term> </termGrp> </languageGrp> <languageGrp> <language type="French" lang="fr-FR" /> <termGrp> <term>étape</term> </termGrp> </languageGrp> </conceptGrp>
entries.New(entryContent,true)