Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In order to use transformation manager from another epsos common component you can use the following part of code

Transform Document

Code Block
// Here is the target language of the transformation method
lrtLang="el-GR";
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("ctx_tm.xml");
ITransformationService tService = (ITransformationService) applicationContext.getBean(ITransformationService.class.getName());
TMResponseStructure tmResponse = tService.translate(doc, ltrLang);
Document translatedDoc = tmResponse.getResponseCDA();

As you can see you have to have access to ctx_tm.xml file in your application. A sample ctx_tm.xml file can be found here 

Get List of Available Languages exist in the LTR Database

Code Block
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("ctx_tm.xml");
ITransformationService tService = (ITransformationService) applicationContext.getBean(ITransformationService.class.getName());
List<String> ltrLanguages = tService.getLtrLanguages();