Package com.ptc.tml.utils
Class TranslationProcess
java.lang.Object
com.ptc.tml.utils.TranslationProcess
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
Supported API: true
-
Method Summary
Modifier and TypeMethodDescriptionstatic ManagedBaselinecreateBaseline(TranslationCollection collection, TmlLog log) Create translation objects and a translation baseline from a TranslationCollection.static FilecreateTranslationPackage(ManagedBaseline baseline, String sourceOid, String sourceLang, String targetLang, String userName, String outputDir, WTContainer contextContainer, TmlLog log) Export a translation package from a translation baseline.static FilecreateTranslationQuotePackage(Collection<EPMDocument> docs, TranslationCollection collection, TmlLog log) Export a quote package containing the specified documents.expandDocumentRefs(TranslationCollection collection, TmlLog log) Convert a TranslationCollection to a list of document references; this is used in quote package processing in lieu of baselines.static voidimportTranslationPackage(ManagedBaseline baseline, String sourceLang, String targetLang, File packageFile, WTPrincipal user, TmlImportLog log) 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.
-
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 packagelog- - 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 exportedsourceOid- - Oid of source object used to create translation baselinesourceLang- - Language code of source language for this translation packagetargetLang- - Language code of target language for this translation packageuserName- - Name of user who initiated translation package; used in loggingoutputDir- - Directory where the translation package/error log will to be writtencontextContainer- - Container which provides context for translation process; i.e. preference valueslog- - 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 packagecollection- - Translation Collection containing meta-data used for quote packagelog- - 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 packagesourceLang- - Language code for source language of the translation packagetargetLang- - Language code for target language of the translation packagepackageFile- - File containing translation packageuser- - User who initiated translation package; used in logginglog- - Logging related to errors, warnings, notes- Throws:
TranslationException
-