Class TranslationProcess

java.lang.Object
com.ptc.tml.utils.TranslationProcess

public class TranslationProcess extends Object
Public APIs for high-level translation operations. Translation workflow calls into this and customizers who wish to avoid wofkflow may use these APIs.

Supported API: true
  • Method Details

    • createBaseline

      public static ManagedBaseline createBaseline(TranslationCollection collection, TmlLog log) throws TranslationException
      Create translation objects and a translation baseline from a TranslationCollection. This method is intended to be called from translation workflow; though nothing prevents it from being called in other contexts.

      Supported API: true
      Parameters:
      collection - - Collection containing document references and meta-data used for creating translation objects, baseline, and package
      log - - Logging related to errors, warnings, notes
      Returns:
      - Baseline with references to newly created translation objects
      Throws:
      TranslationException
    • createTranslationPackage

      public static File createTranslationPackage(ManagedBaseline baseline, String sourceOid, String sourceLang, String targetLang, String userName, String outputDir, WTContainer contextContainer, TmlLog log) throws TranslationException
      Export a translation package from a translation baseline. This method is intended to be called from translation workflow; though nothing prevents it from being called in other contexts.

      Supported API: true
      Parameters:
      baseline - - Baseline with references to translation objects to be exported
      sourceOid - - Oid of source object used to create translation baseline
      sourceLang - - Language code of source language for this translation package
      targetLang - - Language code of target language for this translation package
      userName - - Name of user who initiated translation package; used in logging
      outputDir - - Directory where the translation package/error log will to be written
      contextContainer - - Container which provides context for translation process; i.e. preference values
      log - - Logging related to errors, warnings, notes
      Returns:
      - File reference to created translation package or null on failure
      Throws:
      TranslationException
    • createTranslationQuotePackage

      public static File createTranslationQuotePackage(Collection<EPMDocument> docs, TranslationCollection collection, TmlLog log) throws TranslationException
      Export a quote package containing the specified documents. This method is intended to be called from translation workflow; though nothing prevents it from being called in other contexts.

      Supported API: true
      Parameters:
      docs - - Collection of documents to include in quote package
      collection - - Translation Collection containing meta-data used for quote package
      log - - Logging related to errors, warnings, notes
      Returns:
      - File reference to created quote package or null on failure
      Throws:
      TranslationException
    • expandDocumentRefs

      public static ArrayList<String> expandDocumentRefs(TranslationCollection collection, TmlLog log) throws TranslationException
      Convert a TranslationCollection to a list of document references; this is used in quote package processing in lieu of baselines. This method is intended to be called from translation workflow; though nothing prevents it from being called in other contexts.

      Supported API: true
      Parameters:
      collection -
      log -
      Returns:
      Throws:
      TranslationException
    • importTranslationPackage

      public static void importTranslationPackage(ManagedBaseline baseline, String sourceLang, String targetLang, File packageFile, WTPrincipal user, TmlImportLog log) throws TranslationException
      Import a translation package; translation objects will be iterated and their content updated This method is intended to be called from translation workflow; though nothing prevents it from being called in other contexts.

      Supported API: true
      Parameters:
      baseline - - Baseline used to create translation package
      sourceLang - - Language code for source language of the translation package
      targetLang - - Language code for target language of the translation package
      packageFile - - File containing translation package
      user - - User who initiated translation package; used in logging
      log - - Logging related to errors, warnings, notes
      Throws:
      TranslationException