de.folt.models.datamodel
Interface DataSource

All Superinterfaces:
java.util.Enumeration<MultiLingualObject>, java.util.Observer
All Known Implementing Classes:
ArayaDataSource, BasicDataSource, Csv, DB4O, ExtendedBasicDataSource, GoogleTranslate, IateTerminology, MicrosoftTranslate, MTMoses, MultiLingualObjectCollection, MultipleDataSource, OpenTMSSQLDataSource, ParallelCorpus, TbxFileDataSource, TmxFileDataSource, TradosTMDataSource, XliffFileDataSource

public interface DataSource
extends java.util.Observer, java.util.Enumeration<MultiLingualObject>

Interface implements the main methods a data source must support.

Author:
klemens

Method Summary
 void addData(java.lang.String key, java.lang.Object object)
          addData this allows to add a whatever object to the data source based on a key
 boolean addMonoLingualObject(MonoLingualObject monoLingualObject, boolean bMergeObjects)
          addMultiLingualObject adds a MonoLingualObject to the given MultiLingualObject to the data source
 boolean addMultiLingualObject(MultiLingualObject multiLingualObject, boolean bMergeObjects)
          addMultiLingualObject adds a MultiLingualObject to the data source
 boolean bAuthenticate(java.lang.String userName, java.lang.String password)
          bAuthenticate checks if for a given data source access is granted thru user and password
 boolean bPersist()
          bPersist method persists any data in the data source
 boolean bSupportMultiThreading()
          bSupportMultiThreading defines support of multi threading (mainly for translate method)
 java.util.Vector<MonoLingualObject> changedMonolingualObjects()
          changedMonolingualObjects
 TranslationCheckResult checkIfTranslationExistsInDataSource(MonoLingualObject source, MonoLingualObject target)
          checkIfTranslationExistsInDataSource Method checks if a for a given source and target MOL matches in the data source exist.
 TranslationCheckResult checkIfTranslationExistsInDataSource(java.lang.String sourceSegment, java.lang.String sourceLanguage, java.lang.String targetSegment, java.lang.String targetLanguage)
          checkIfTranslationExistsInDataSource function checks if for a given combination of source segment/source language - target segment (translation)/target language a translation exists
 void cleanDataSource()
          cleanDataSource method is used to allow some clean operations e.g. after an instance has been loaded.
 boolean clearDataSource()
          clearDataSource removes the content in a data source.
 boolean containsKey(java.lang.String key)
          containsKey checks if a key exists
 boolean containsValue(java.lang.Object object)
          containsValue checks if a key exists
 int copyFrom(DataSource dataSource)
          copyFrom copies the content of the data source dataSource to the this data source; this requires that the data source implements the methods nextElement; iniEnumeration and hasMoreElements.
 int copyTo(DataSource dataSource)
          copyTo copies the content of this data source to the specified data source; this requires that the data source implements the methods nextElement; iniEnumeration and hasMoreElements.
 boolean createDataSource(DataSourceProperties dataModelProperties)
          createDataSource creates a new Data source; this is esp. intended for creating a new database, e.g. in MySQL or Ms SQL Server.
 long currentTimeMillis()
          currentTimeMillis This method returns the current time as a String.
 boolean deleteDataSource(DataSourceProperties dataModelProperties)
          deleteDataSource deletes an existing Data source; this is esp. intended for deleting a database, e.g. in MySQL or Ms SQL Server.
 int exportTmxFile(java.lang.String tmxFile)
          exportTmxFile exports the data source into an tmx file
 int exportXliffFile(java.lang.String xliffFile)
          exportXliffFile export the xliff file from the data source;
 void getAllAttributes(java.lang.String outputfile)
          Write all Attributes and values to output file
 java.util.Vector<java.lang.Integer> getChangedIds()
          getChangedIds this method returns a vector of Integers of changed MULs which uniquely identify each MUL of the data source
 java.lang.Object getData(java.lang.String key)
          getData retrieves an object associated with the key
 java.lang.String getDataSourceName()
          getDataSourceName returns the name of the data source
 DataSourceProperties getDataSourceProperties()
          getDataSourceProperties returns the DataSourceProperties of the data source
 java.lang.String getDataSourceType()
          getDataSourceType get the type of the database
 java.lang.String getDefaultDataSourceConfigurationsFileName()
          getDefaultDataSourceConfigurationsFileName return the name of the default data source configurations file name
 java.util.Vector<java.lang.Integer> getIds()
          getIds this method returns a vector of Integers which uniquely identify each MUL of the data source
 int getLastErrorCode()
          getLastErrorCode Method returns the last error code for an operation done by the data source
 MonoLingualObject getMonoLingualObjectFromId(java.lang.String uniqueID)
          getMonoLingualObjectFromId search an MOL based on its (integer) id
 MonoLingualObject getMonoLingualObjectFromUniqueId(java.lang.String uniqueID)
          getMonoLingualObjectFromUniqueId search an MOL based on its (integer) id
 MultiLingualObject getMultiLingualObjectFromId(java.lang.String id)
          getMultiLingualObjectFromId search an MUL based on its unique id
 MultiLingualObject getMultiLingualObjectFromUniqueId(java.lang.String id)
          getMultiLingualObjectFromUniqueId search an MUL based on its unique id
 java.util.Vector<java.lang.String> getUniqueIds()
          getUniqueIds this method returns a vector of strings which uniquely identify each MUL of the data source
 int importTbxFile(java.lang.String tbxFile)
          importTbxFile imports a tbx file into the data source;
 int importTmxFile(java.lang.String tmxFile)
          importTmxFile import a tmx file into the datasource
 int importXliffFile(java.lang.String xliffFile)
          importXliffFile imports an xliff file into the data source; it imports the approved source / target's of the trans-units
 void initEnumeration()
          initEnumeration initialises the Enumeration of the data source
 boolean isBLoadAttributesLazy()
          This method determines if the attributes of MultiLingualObjects or MonoLingualObjects should be loaded at the time when the data source is created (false) or when they are actually needed (true).
 boolean isSyncDataSource()
          This methods returns true if the data source (the instance of the data source) is a synchronizable data source instance.
 java.lang.Object removeData(java.lang.String key)
          removeData removes an object associated with the key
 void removeDataSource()
          removeDataSource method called when the DataSource should be removed
 boolean removeMonoLingualObject(MonoLingualObject monoLingualObject)
          removeMonoLingualObject removes a MonoLingualObject from the data source; not all data source may support this method and may return false in any case (e.g.
 boolean removeMultiLingualObject(MultiLingualObject multiLingualObject)
          removeMultiLingualObject removes a MultiLingualObject from the data source
 boolean saveModifiedMonoLingualObject(MonoLingualObject monoLingualObject)
          saveModifiedMonoLingualObject save a given MonoLingualObject in the data source by replacing the old values.
 boolean saveModifiedMultiLingualObject(MultiLingualObject mul)
          saveModifiedMultiLingualObject saves any modification of the MultiLingualObject, esp. doen to the LinguisticProperties
 java.util.Vector<MonoLingualObject> search(MonoLingualObject searchMonoLingualObject, java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
          search search for a MonoLingualObject; if no language is given in the searchMonoLingualObject the search is done independent of the language
 java.util.Vector<MonoLingualObject> searchRegExp(MonoLingualObject searchMonoLingualObject, java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
          search searchRegExp for a MonoLingualObject where the plain text represents a regular expression; if no language is given in the searchMonoLingualObject the search is done independent of the language
 java.util.Vector<MonoLingualObject> searchWordBased(MonoLingualObject searchMonoLingualObject, java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
          search searchWordBased for a MonoLingualObject where the plain text segment is searched by splitting it up into words; if no language is given in the searchMonoLingualObject the search is done independent of the language
 void setBLoadAttributesLazy(boolean loadAttributesLazy)
          This method sets loading of the the attributes of MultiLingualObjects or MonoLingualObjects; false = they should be loaded at the time when the data source is created or true = when they are actually needed.
 void setDataSourceType()
          setDataSourceType sets the type of the data source
 void setDefaultDataSourceConfigurationsFileName(java.lang.String defaultDataSourceConfigurationsFileName)
          setDefaultDataSourceConfigurationsFileName set the name of the default data source configurations file name
 void setLastErrorCode(int lastErrorCode)
          setLastErrorCode sets the error code of the currently running method of the data source
 org.jdom.Element[] subSegmentResultsToGlossary(java.lang.String sourceLanguage, java.lang.String targetLanguage)
          subSegmentResultsToGlossary returns an array of glossary elements for the subSegment matching translations
 org.jdom.Element subSegmentTranslate(org.jdom.Element transUnit, XliffDocument xliffDocument, java.lang.String sourceLanguage, java.lang.String targetLanguage, java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
          translate subSegmentTranslate a trans-unit given the source language, target Language on a sub segment level (e.g.phrase or terminology based)
 org.jdom.Element translate(org.jdom.Element transUnit, org.jdom.Element file, XliffDocument xliffDocument, java.lang.String sourceLanguage, java.lang.String targetLanguage, int matchSimilarity, java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
          translate translates a trans-unit given the source language, target Language and match similarity
 void update()
          This method can be called after insert or similar actions to update internal stati, fuzzy trees etc.
 
Methods inherited from interface java.util.Observer
update
 
Methods inherited from interface java.util.Enumeration
hasMoreElements, nextElement
 

Method Detail

addData

void addData(java.lang.String key,
             java.lang.Object object)
addData this allows to add a whatever object to the data source based on a key

Parameters:
key - the key for the object
object - the value for the key

addMonoLingualObject

boolean addMonoLingualObject(MonoLingualObject monoLingualObject,
                             boolean bMergeObjects)
addMultiLingualObject adds a MonoLingualObject to the given MultiLingualObject to the data source

Parameters:
monoLingualObject - the MOL object to add
bMergeObjects - if true first a search is done if the containing MonoLingualObjects exist in the data source (based on the segment text); if they exist they are merged; if false the MUL is added as new entry
Returns:
true if added; false if the MultiLingualObject does not exist

addMultiLingualObject

boolean addMultiLingualObject(MultiLingualObject multiLingualObject,
                              boolean bMergeObjects)
addMultiLingualObject adds a MultiLingualObject to the data source

Parameters:
multiLingualObject - the object to add
bMergeObjects - if true first a search is done if the containing MonoLingualObjects exist in the data source (based on the segment text); if they exist they are merged; if false the MUL is added as new entry
Returns:
true if added; false if not

bAuthenticate

boolean bAuthenticate(java.lang.String userName,
                      java.lang.String password)
bAuthenticate checks if for a given data source access is granted thru user and password

Parameters:
userName - the user name
password - the password
Returns:
true if user / password does match and access granted, false if user / password does not match

bPersist

boolean bPersist()
bPersist method persists any data in the data source

Returns:
true in case of success or false otherwise

bSupportMultiThreading

boolean bSupportMultiThreading()
bSupportMultiThreading defines support of multi threading (mainly for translate method)

Returns:
true if multi threading of data source access (for translate) is supported or not (=false)

changedMonolingualObjects

java.util.Vector<MonoLingualObject> changedMonolingualObjects()
changedMonolingualObjects

Returns:
a Vector of changed or new MonoLingualObjects since the last read operation

checkIfTranslationExistsInDataSource

TranslationCheckResult checkIfTranslationExistsInDataSource(MonoLingualObject source,
                                                            MonoLingualObject target)
checkIfTranslationExistsInDataSource Method checks if a for a given source and target MOL matches in the data source exist.
This is a more complex version of checkIfTranslationExistsInDataSource(String sourceSegment, String sourceLanguage, String targetSegment, String targetLanguage) as it checks for the linguistic properties of the involved mono lingual objects too.

Parameters:
source - the source MOL
target - the target MOL
Returns:
a SearchStatusResult object

checkIfTranslationExistsInDataSource

TranslationCheckResult checkIfTranslationExistsInDataSource(java.lang.String sourceSegment,
                                                            java.lang.String sourceLanguage,
                                                            java.lang.String targetSegment,
                                                            java.lang.String targetLanguage)
checkIfTranslationExistsInDataSource function checks if for a given combination of source segment/source language - target segment (translation)/target language a translation exists

Parameters:
sourceSegment - the source segment
sourceLanguage - the source language
targetSegment - the target segment
targetLanguage - the target language
Returns:
a TranslationCheckResult (for more details see TranslationCheckResult)

cleanDataSource

void cleanDataSource()
cleanDataSource method is used to allow some clean operations e.g. after an instance has been loaded.
An example is disposing a tmx document after having read all the entries.


clearDataSource

boolean clearDataSource()
                        throws OpenTMSException
clearDataSource removes the content in a data source. In addition it can be used to delete a TMX data source.

Returns:
true if success
Throws:
OpenTMSException

containsKey

boolean containsKey(java.lang.String key)
containsKey checks if a key exists

Parameters:
key - the key to search for
Returns:
true if key exists, otherwise false

containsValue

boolean containsValue(java.lang.Object object)
containsValue checks if a key exists

Parameters:
object - the object (value) to search for
Returns:
true if key exists, otherwise false

copyFrom

int copyFrom(DataSource dataSource)
copyFrom copies the content of the data source dataSource to the this data source; this requires that the data source implements the methods nextElement; iniEnumeration and hasMoreElements. Those methods are used to get the MultiLingualObject and store them.

Parameters:
dataSource -

copyTo

int copyTo(DataSource dataSource)
copyTo copies the content of this data source to the specified data source; this requires that the data source implements the methods nextElement; iniEnumeration and hasMoreElements. Those methods are used to get the MultiLingualObject and store them.

Parameters:
dataSource -

createDataSource

boolean createDataSource(DataSourceProperties dataModelProperties)
                         throws OpenTMSException
createDataSource creates a new Data source; this is esp. intended for creating a new database, e.g. in MySQL or Ms SQL Server. In addition it can be used to create a new empty TMX data source.

Parameters:
dataModelProperties - the parameters of the data source
Returns:
true if success
Throws:
OpenTMSException

currentTimeMillis

long currentTimeMillis()
currentTimeMillis This method returns the current time as a String. The method should return the date/time where the data source is running (e.g. the database server time). The method is mainly used to add time stamps to the MUL/MOL objetcs (creation, update, delete). It should return the server time in order to allow comparsion between different users running (client sided) OpenTMS software. The result is used to synchronise the acesses between differetn users/processes.

Returns:
date/time as a long - similar to currentTimeMillis() in Java (the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.)

deleteDataSource

boolean deleteDataSource(DataSourceProperties dataModelProperties)
                         throws OpenTMSException
deleteDataSource deletes an existing Data source; this is esp. intended for deleting a database, e.g. in MySQL or Ms SQL Server. In addition it can be used to delete a TMX data source.
Currently supported key values are:
tmxfile, tmxFile, dataSourceName, dataSource, xlifffile, xliffFile - specifies names of the data sources
sourceLanguage if an xliff File datasource is created default = de
targetLanguage if an xliff File datasource is created default = en

Parameters:
dataModelProperties - the parameters of the data source
Returns:
true if success
Throws:
OpenTMSException

exportTmxFile

int exportTmxFile(java.lang.String tmxFile)
exportTmxFile exports the data source into an tmx file

Parameters:
tmxFile - the tmx file to export to
Returns:
the number of entries exported

exportXliffFile

int exportXliffFile(java.lang.String xliffFile)
exportXliffFile export the xliff file from the data source;

Parameters:
xliffFile - the xliff file to export
Returns:
the number of entries exported

getAllAttributes

void getAllAttributes(java.lang.String outputfile)
Write all Attributes and values to output file

Parameters:
outputfile - target output file

getChangedIds

java.util.Vector<java.lang.Integer> getChangedIds()
getChangedIds this method returns a vector of Integers of changed MULs which uniquely identify each MUL of the data source

Returns:
a vector with the MUL unique ids

getData

java.lang.Object getData(java.lang.String key)
getData retrieves an object associated with the key

Parameters:
key - the key to search for
Returns:
the object found

getDataSourceName

java.lang.String getDataSourceName()
getDataSourceName returns the name of the data source

Returns:

getDataSourceProperties

DataSourceProperties getDataSourceProperties()
                                             throws OpenTMSException
getDataSourceProperties returns the DataSourceProperties of the data source

Returns:
the DataSourceProperties
Throws:
OpenTMSException

getDataSourceType

java.lang.String getDataSourceType()
getDataSourceType get the type of the database

Returns:
the data source type

getDefaultDataSourceConfigurationsFileName

java.lang.String getDefaultDataSourceConfigurationsFileName()
getDefaultDataSourceConfigurationsFileName return the name of the default data source configurations file name

Returns:
the default configuration file name

getIds

java.util.Vector<java.lang.Integer> getIds()
getIds this method returns a vector of Integers which uniquely identify each MUL of the data source

Returns:
a vector with the unique ids

getLastErrorCode

int getLastErrorCode()
getLastErrorCode Method returns the last error code for an operation done by the data source

Returns:
an OpenTMS Error code describing the error which occurred for the last operation

getMonoLingualObjectFromId

MonoLingualObject getMonoLingualObjectFromId(java.lang.String uniqueID)
getMonoLingualObjectFromId search an MOL based on its (integer) id

Parameters:
uniqueID -
Returns:
the MOL found or null otherwise

getMonoLingualObjectFromUniqueId

MonoLingualObject getMonoLingualObjectFromUniqueId(java.lang.String uniqueID)
getMonoLingualObjectFromUniqueId search an MOL based on its (integer) id

Parameters:
uniqueID - the id to search (as String)
Returns:
the MOL found or null otherwise

getMultiLingualObjectFromId

MultiLingualObject getMultiLingualObjectFromId(java.lang.String id)
getMultiLingualObjectFromId search an MUL based on its unique id

Parameters:
id - the id to search (as String)
Returns:
the MOL found or null otherwise

getMultiLingualObjectFromUniqueId

MultiLingualObject getMultiLingualObjectFromUniqueId(java.lang.String id)
getMultiLingualObjectFromUniqueId search an MUL based on its unique id

Parameters:
id - the id to search (as String)
Returns:
the MUL found or null otherwise

getUniqueIds

java.util.Vector<java.lang.String> getUniqueIds()
getUniqueIds this method returns a vector of strings which uniquely identify each MUL of the data source

Returns:

importTbxFile

int importTbxFile(java.lang.String tbxFile)
importTbxFile imports a tbx file into the data source;

Parameters:
tbxFile - the tbx file to import
Returns:
the number of entries imported

importTmxFile

int importTmxFile(java.lang.String tmxFile)
importTmxFile import a tmx file into the datasource

Parameters:
tmxFile - the tmx file to import
Returns:

importXliffFile

int importXliffFile(java.lang.String xliffFile)
importXliffFile imports an xliff file into the data source; it imports the approved source / target's of the trans-units

Parameters:
xliffFile - the xliff file to import
Returns:
the number of entries imported

initEnumeration

void initEnumeration()
initEnumeration initialises the Enumeration of the data source


isBLoadAttributesLazy

boolean isBLoadAttributesLazy()
This method determines if the attributes of MultiLingualObjects or MonoLingualObjects should be loaded at the time when the data source is created (false) or when they are actually needed (true).

Returns:
the bLoadAttributesLazy true if the should be loaded when need / false when they should be loaded at creation time of the data source.

isSyncDataSource

boolean isSyncDataSource()
This methods returns true if the data source (the instance of the data source) is a synchronizable data source instance.

Returns:
true if this is a synchronizable data source

removeData

java.lang.Object removeData(java.lang.String key)
removeData removes an object associated with the key

Parameters:
key - the key to remove
Returns:
the object removed

removeDataSource

void removeDataSource()
                      throws OpenTMSException
removeDataSource method called when the DataSource should be removed

Throws:
OpenTMSException

removeMonoLingualObject

boolean removeMonoLingualObject(MonoLingualObject monoLingualObject)
removeMonoLingualObject removes a MonoLingualObject from the data source; not all data source may support this method and may return false in any case (e.g. XliffDataSource)

Parameters:
monoLingualObject - the MUL to remove
Returns:
true if removed; false if not

removeMultiLingualObject

boolean removeMultiLingualObject(MultiLingualObject multiLingualObject)
removeMultiLingualObject removes a MultiLingualObject from the data source

Parameters:
multiLingualObject - the MOL to remove
Returns:
true if removed; false if not

saveModifiedMonoLingualObject

boolean saveModifiedMonoLingualObject(MonoLingualObject monoLingualObject)
saveModifiedMonoLingualObject save a given MonoLingualObject in the data source by replacing the old values. It is now allowed to change the uniquei and the id of the MOL.

Parameters:
monoLingualObject - the mono lingual object to save return true for success, false otherwise

saveModifiedMultiLingualObject

boolean saveModifiedMultiLingualObject(MultiLingualObject mul)
saveModifiedMultiLingualObject saves any modification of the MultiLingualObject, esp. doen to the LinguisticProperties

Parameters:
mul - the MultiLingualObject
Returns:
true if success

search

java.util.Vector<MonoLingualObject> search(MonoLingualObject searchMonoLingualObject,
                                           java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
search search for a MonoLingualObject; if no language is given in the searchMonoLingualObject the search is done independent of the language

Parameters:
searchMonoLingualObject - the MonoLingualObject to search for
searchParameters - the hash table contains search parameters (e.g. language to search for etc.)
Example: matchMultiLingualLinguisticProperties for MultiLingualObjects or matchMonoLingualLinguisticProperties for MonoLingualObjects as filters
Returns:
a vector of MOL which contain the segments of the given monoLingualObject

searchRegExp

java.util.Vector<MonoLingualObject> searchRegExp(MonoLingualObject searchMonoLingualObject,
                                                 java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
search searchRegExp for a MonoLingualObject where the plain text represents a regular expression; if no language is given in the searchMonoLingualObject the search is done independent of the language

Parameters:
searchMonoLingualObject - the MonoLingualObject to search for
searchParameters - the hash table contains search parameters (e.g. language to search for etc.)
Returns:
a vector of MOL which contain segment of the given monoLingualObject

searchWordBased

java.util.Vector<MonoLingualObject> searchWordBased(MonoLingualObject searchMonoLingualObject,
                                                    java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
search searchWordBased for a MonoLingualObject where the plain text segment is searched by splitting it up into words; if no language is given in the searchMonoLingualObject the search is done independent of the language

Parameters:
searchMonoLingualObject - the MonoLingualObject to search for
searchParameters - the hash table contains search parameters (e.g. language to search for etc.);
Returns:
a vector of MOL which contain segment of the given monoLingualObject

setBLoadAttributesLazy

void setBLoadAttributesLazy(boolean loadAttributesLazy)
This method sets loading of the the attributes of MultiLingualObjects or MonoLingualObjects; false = they should be loaded at the time when the data source is created or true = when they are actually needed.

Parameters:
loadAttributesLazy - the bLoadAttributesLazy to set; false = load at creation time; true load at time when needed

setDataSourceType

void setDataSourceType()
setDataSourceType sets the type of the data source


setDefaultDataSourceConfigurationsFileName

void setDefaultDataSourceConfigurationsFileName(java.lang.String defaultDataSourceConfigurationsFileName)
setDefaultDataSourceConfigurationsFileName set the name of the default data source configurations file name

Parameters:
defaultDataSourceConfigurationsFileName - the name of the default data source configurations file name

setLastErrorCode

void setLastErrorCode(int lastErrorCode)
setLastErrorCode sets the error code of the currently running method of the data source

Parameters:
lastErrorCode - the error code

subSegmentResultsToGlossary

org.jdom.Element[] subSegmentResultsToGlossary(java.lang.String sourceLanguage,
                                               java.lang.String targetLanguage)
subSegmentResultsToGlossary returns an array of glossary elements for the subSegment matching translations

Parameters:
sourceLanguage - the source language for the glossary
targetLanguage - the target language for the glossary
Returns:
the glossary element

subSegmentTranslate

org.jdom.Element subSegmentTranslate(org.jdom.Element transUnit,
                                     XliffDocument xliffDocument,
                                     java.lang.String sourceLanguage,
                                     java.lang.String targetLanguage,
                                     java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
                                     throws OpenTMSException
translate subSegmentTranslate a trans-unit given the source language, target Language on a sub segment level (e.g.phrase or terminology based)

Parameters:
transUnit - the trans unit to translate to use
xliffDocument - the basic xliff document
sourceLanguage - the source language to use
targetLanguage - the target language to use
translationParameters - the hash table contains parameters which control some parameters, e.g. should header/source/target properties be written to alt-trans
Returns:
the modified trans-unit with new translation
Throws:
OpenTMSException

translate

org.jdom.Element translate(org.jdom.Element transUnit,
                           org.jdom.Element file,
                           XliffDocument xliffDocument,
                           java.lang.String sourceLanguage,
                           java.lang.String targetLanguage,
                           int matchSimilarity,
                           java.util.Hashtable<java.lang.String,java.lang.Object> translationParameters)
                           throws OpenTMSException
translate translates a trans-unit given the source language, target Language and match similarity

Parameters:
transUnit - the trans unit to translate to use
file - the file element currently to translate
xliffDocument - the basic xliff document
sourceLanguage - the source language to use
targetLanguage - the target language to use
matchSimilarity - the similarity (fuzzy) match quality (0 - 100) to use
translationParameters - the hash table contains parameters which control some parameters, e.g. should header/source/target properties be written to alt-trans
Returns:
the modified trans-unit with new translation
Throws:
OpenTMSException

update

void update()
This method can be called after insert or similar actions to update internal stati, fuzzy trees etc.