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 Reply Children
  • 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.

  • Hi ,

    can you please provide complete and WORKING(!!!) example of fully automated/unattended import of complete termbase (i.e. all languages) from XML/XDT, using just the default export/import definitions?
    I cannot make the ProcessImport work.
    And the MultiTerm SDK documentation is tragically incomplete and bad.

    Here is what I do (the termbase XML and XDT already exist):

    1. create new local termbase
    2. get the termbase's "Default import definition" object's "Content" property (the XML)
    3. modify content of the XML:
      • put full path of the termbase XML to "XMLFile" element
      • put full path of import log to "LogFile" element (or should it be ErrorFile?! how should I know?! no documentation... no CLEAR element names, not corresponding to UI elements either! :( )
    4. save the modified XML to file
    5. use the import definition object's "Load" method to load the modified XML and update the existing "Default import definition"
      • (when I now display the "Content" property, I see the modifications there)
    6. use the import definition object's "ProcessImport" method
      • when used with "mtScript" parameter, nothing happens - nothing gets imported, empty log is created (containing only XML declaration line)
      • when used with "mtWizard" parameter, EMPTY wizard opens WITHOUT any added paths or other modifications done in step 3

    WHAT THE HECK IS GOING ON?!
    I spent 2 days by trials and errors already, all to no avail... due to TOTALLY BAD OR MISSING DOCUMENTATION :(

    The definitions objects are total mystery - programmatically saved definition (using "Save" method) fails being added using the definitions collection "Add" method! What's going on?!

    • The "Content" displays only various options/settings enclosed in "List" element
    • but after using the "Save" method, everything gets enclosed into additional "object" root element and adds 3 more elements: name, description,  :-O
    • ...but saving the definition from GUI adds one more option: FullReorgOption :-O :-O

    Can I have some official SDL statement to this unbelievable CHAOS?

     

  • He-lloooo?!
    Does anyone from SDL actually care about poor people willing to use the SDKs?!?!
  • Hi ,

    Can you give me some sample data and we'll have a developer take a look at it once we have someone available.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Paul, this is not about particular sample data... any data will do.
    It's about generic functionality, which simply seems to work totally weirdly and/or completely differently than documented (IF it's documented at all...).

    And to be honest, that "once we have someone available" is what I'm afraid most... because based on what one can see in the forums, it's likely to be "in a few years"... :-\
  • Almost a month later and no reaction... not mentioning a SOLUTION....

    BTW,. does the 'advertised' support & maintenance contract ENSURE actually getting the problems SOLVED within a SENSIBLE TIMEFRAME (I'm talking about SOLUTION, not about plain response, which is pretty irrelevant)? Or will everything end up anyway in the same "it's bug number XYZ for your reference", which I get even without paying extra money... and which I can just stick up to whatever for next decade or so since no one will bother actually solving the problem anyway?