MultiTerm SDK: Importing Entries/Terms

Hello again,


I'm trying to find the information regarding importing entries/terms from an XML file into a termbase, using the MultiTerm SDK.

I've found ImportDefinitions, but does this only apply to the XDT definitions, rather than the XML termbase content?

Thanks in advance,

Samuel

Parents
  • Hi Samuel,

    ImportDefinitions define what kind of import settings you want to use (Merge, overwrite etc.) and are XDI files. Typically you can use one of the existing ImportDefinitions we pre-load into every termbase

    To run the actual import you need to use "ProcessImport" referring to an existing ImportDefinition.

    XDTs are not related to the import process, only to termbase creation.

    Thanks,
    Luis

    Best regards,
    Luis Lopes | Principal Product Manager | RWS | (twitter) @Luis___Lopes |

  • Hi Luis,
    Thanks for the reply, I think I understand the process in theory...although I'm still having trouble finding the example of importing the entries/terms from an external (MultiTerm) XML file.
    Something like:
    - Define the termbase
    - Define the ImportDefinitions
    - presumably at some point an XML file has to be referenced?
    - ProcessImport
    Thanks in advance,
    Samuel
  • Hi Samuel,

    The reference to the XML file is part of the ImportDefinition object, I don't think you can programmatically change the content of it, so you'd have to manipulate XML or use the wizard.
    Maybe it helps if you go through the flow once in MultiTerm to see what a ImportDefinition holds.

    To execute you only need this:

    Applying this method to an import definition runs the import. It requires the task type as parameter, i.e. whether the import should be run in script mode (i.e. without the wizard) or using the import wizard. In addition you can provide the optional source/target index parameters. Note that import definitions can use the source/target index as logical fields.

    //select termbase
    Termbase oTb = oTbs["Termbase name"];

    //select an import definition
    ImportDefinitions oImpDefs = oTb.ImportDefinitions;
    ImportDefinition oExpDef = oImpDefs["Default import definition"];
    oImpDef.ProcessImport(Sdl.MultiTerm.TMO.Interop.MtTaskType.mtScript, "English", "German");


    Thanks,
    Luis

    Best regards,
    Luis Lopes | Principal Product Manager | RWS | (twitter) @Luis___Lopes |

  • Hi Luis,

    Yeah, got it now.

    FYI: I think there might be a typo in the CHM and your reply:

    ImportDefinition oExpDef = oImpDefs["Default import definition"];
    oImpDef.ProcessImport(Sdl.MultiTerm.TMO.Interop.MtTaskType.mtScript, "English", "German");

     should be:

    ImportDefinition oImpDef = oImpDefs["Default import definition"];
    oImpDef.ProcessImport(Sdl.MultiTerm.TMO.Interop.MtTaskType.mtScript, "English", "German");

     Thanks for your help and guidance.

Reply Children
No Data