|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataSource
Interface implements the main methods a data source must support.
| 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 |
|---|
void addData(java.lang.String key,
java.lang.Object object)
key - the key for the objectobject - the value for the key
boolean addMonoLingualObject(MonoLingualObject monoLingualObject,
boolean bMergeObjects)
monoLingualObject - the MOL object to addbMergeObjects - 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
boolean addMultiLingualObject(MultiLingualObject multiLingualObject,
boolean bMergeObjects)
multiLingualObject - the object to addbMergeObjects - 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
boolean bAuthenticate(java.lang.String userName,
java.lang.String password)
userName - the user namepassword - the password
boolean bPersist()
boolean bSupportMultiThreading()
java.util.Vector<MonoLingualObject> changedMonolingualObjects()
TranslationCheckResult checkIfTranslationExistsInDataSource(MonoLingualObject source,
MonoLingualObject target)
source - the source MOLtarget - the target MOL
TranslationCheckResult checkIfTranslationExistsInDataSource(java.lang.String sourceSegment,
java.lang.String sourceLanguage,
java.lang.String targetSegment,
java.lang.String targetLanguage)
sourceSegment - the source segmentsourceLanguage - the source languagetargetSegment - the target segmenttargetLanguage - the target language
TranslationCheckResult)void cleanDataSource()
boolean clearDataSource()
throws OpenTMSException
OpenTMSExceptionboolean containsKey(java.lang.String key)
key - the key to search for
boolean containsValue(java.lang.Object object)
object - the object (value) to search for
int copyFrom(DataSource dataSource)
dataSource - int copyTo(DataSource dataSource)
dataSource -
boolean createDataSource(DataSourceProperties dataModelProperties)
throws OpenTMSException
dataModelProperties - the parameters of the data source
OpenTMSExceptionlong currentTimeMillis()
boolean deleteDataSource(DataSourceProperties dataModelProperties)
throws OpenTMSException
dataModelProperties - the parameters of the data source
OpenTMSExceptionint exportTmxFile(java.lang.String tmxFile)
tmxFile - the tmx file to export to
int exportXliffFile(java.lang.String xliffFile)
xliffFile - the xliff file to export
void getAllAttributes(java.lang.String outputfile)
outputfile - target output filejava.util.Vector<java.lang.Integer> getChangedIds()
java.lang.Object getData(java.lang.String key)
key - the key to search for
java.lang.String getDataSourceName()
DataSourceProperties getDataSourceProperties()
throws OpenTMSException
OpenTMSExceptionjava.lang.String getDataSourceType()
java.lang.String getDefaultDataSourceConfigurationsFileName()
java.util.Vector<java.lang.Integer> getIds()
int getLastErrorCode()
MonoLingualObject getMonoLingualObjectFromId(java.lang.String uniqueID)
uniqueID -
MonoLingualObject getMonoLingualObjectFromUniqueId(java.lang.String uniqueID)
uniqueID - the id to search (as String)
MultiLingualObject getMultiLingualObjectFromId(java.lang.String id)
id - the id to search (as String)
MultiLingualObject getMultiLingualObjectFromUniqueId(java.lang.String id)
id - the id to search (as String)
java.util.Vector<java.lang.String> getUniqueIds()
int importTbxFile(java.lang.String tbxFile)
tbxFile - the tbx file to import
int importTmxFile(java.lang.String tmxFile)
tmxFile - the tmx file to import
int importXliffFile(java.lang.String xliffFile)
xliffFile - the xliff file to import
void initEnumeration()
boolean isBLoadAttributesLazy()
boolean isSyncDataSource()
java.lang.Object removeData(java.lang.String key)
key - the key to remove
void removeDataSource()
throws OpenTMSException
OpenTMSExceptionboolean removeMonoLingualObject(MonoLingualObject monoLingualObject)
monoLingualObject - the MUL to remove
boolean removeMultiLingualObject(MultiLingualObject multiLingualObject)
multiLingualObject - the MOL to remove
boolean saveModifiedMonoLingualObject(MonoLingualObject monoLingualObject)
monoLingualObject - the mono lingual object to save return true for success, false
otherwiseboolean saveModifiedMultiLingualObject(MultiLingualObject mul)
mul - the MultiLingualObject
java.util.Vector<MonoLingualObject> search(MonoLingualObject searchMonoLingualObject,
java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
searchMonoLingualObject - the MonoLingualObject to search forsearchParameters - the hash table contains search parameters (e.g. language to
search for etc.)
java.util.Vector<MonoLingualObject> searchRegExp(MonoLingualObject searchMonoLingualObject,
java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
searchMonoLingualObject - the MonoLingualObject to search forsearchParameters - the hash table contains search parameters (e.g. language to
search for etc.)
java.util.Vector<MonoLingualObject> searchWordBased(MonoLingualObject searchMonoLingualObject,
java.util.Hashtable<java.lang.String,java.lang.Object> searchParameters)
searchMonoLingualObject - the MonoLingualObject to search forsearchParameters - the hash table contains search parameters (e.g. language to
search for etc.);
void setBLoadAttributesLazy(boolean loadAttributesLazy)
loadAttributesLazy - the bLoadAttributesLazy to set; false = load at creation time;
true load at time when neededvoid setDataSourceType()
void setDefaultDataSourceConfigurationsFileName(java.lang.String defaultDataSourceConfigurationsFileName)
defaultDataSourceConfigurationsFileName - the name of the default data source configurations file namevoid setLastErrorCode(int lastErrorCode)
lastErrorCode - the error code
org.jdom.Element[] subSegmentResultsToGlossary(java.lang.String sourceLanguage,
java.lang.String targetLanguage)
sourceLanguage - the source language for the glossarytargetLanguage - the target language for the glossary
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
transUnit - the trans unit to translate to usexliffDocument - the basic xliff documentsourceLanguage - the source language to usetargetLanguage - the target language to usetranslationParameters - the hash table contains parameters which control some
parameters, e.g. should header/source/target properties be
written to alt-trans
OpenTMSException
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
transUnit - the trans unit to translate to usefile - the file element currently to translatexliffDocument - the basic xliff documentsourceLanguage - the source language to usetargetLanguage - the target language to usematchSimilarity - the similarity (fuzzy) match quality (0 - 100) to usetranslationParameters - the hash table contains parameters which control some
parameters, e.g. should header/source/target properties be
written to alt-trans
OpenTMSExceptionvoid update()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||