|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.folt.models.datamodel.BasicDataSource
de.folt.models.datamodel.sql.OpenTMSQLDataSource
public class OpenTMSQLDataSource
This class represents a SQl data source. It is realized using Hibernate.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.folt.models.datamodel.BasicDataSource |
|---|
BasicDataSource.BasicDataSourceObserver |
| Constructor Summary | |
|---|---|
OpenTMSQLDataSource(DataSourceProperties dataModelProperties)
The constructor created and associates a data sources for a given set of parameters. |
|
| Method Summary | |
|---|---|
boolean |
addMonoLingualObject(MonoLingualObject monoLingualObject,
boolean mergeObjects)
addMultiLingualObject adds a MonoLingualObject to the given MultiLingualObject to the data source |
boolean |
addMultiLingualObject(MultiLingualObject multiLingualObject,
boolean mergeObjects)
addMultiLingualObject adds a MultiLingualObject to the data source |
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. |
static boolean |
createDatabase(java.lang.String dbname,
java.lang.String hibernateConfigFile)
createDatabase creates a new SQL database |
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. |
static boolean |
deleteDatabase(java.lang.String dbname,
java.lang.String hibernateConfigFile)
deleteDatabase creates a new SQL database |
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. |
static int |
exportTmx(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
exportTmx |
int |
exportTmxFile(java.lang.String tmxFile)
exportTmxFile exports the data source into an tmx file |
static int |
exportToMOL(java.lang.String hibernateConfigFile)
exportToMOL |
java.lang.String |
getDataSourceType()
getDataSourceType get the type of the database |
MonoLingualPartitionedFuzzyNodeTree |
getFuzzyTree()
|
int |
getLastErrorCode()
getLastErrorCode Method returns the last error code for an operation done by the data source |
ObservableHashtable<java.lang.String,MultiLingualObject> |
getMultiLingualObjectCache()
multiLingualObjectCache is a cache object which can be used by the data sources to store read MultiLingual Objects. |
int |
hashCode()
|
int |
importTmxFile(java.lang.String tmxFile)
importTmxFile import a TMX file into the data source |
static int |
importTmxFile(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
importTmxFile |
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 |
static int |
importXliffFile(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
|
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). |
static void |
main(java.lang.String[] args)
main |
void |
removeDataSource()
removeDataSource method called when the DataSource should be removed |
boolean |
removeMonoLingualObject(MonoLingualObject monoLingualObject)
removeMonoLingualObject adds a MultiLingualObject to the data source |
boolean |
removeMultiLingualObject(MultiLingualObject multiLingualObject)
removeMultiLingualObject adds a MultiLingualObject to the data source |
java.util.Vector<MonoLingualObject> |
search(MonoLingualObject searchMonoLingualObject)
search search for a MonoLingualObject; if no language is given in the searchMonoLingualObject the search is done indepenent 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 |
setFuzzyTree(MonoLingualPartitionedFuzzyNodeTree fuzzyTree)
|
void |
setLastErrorCode(int lastErrorCode)
setLastErrorCode sets the error code of the currently running method of the data source |
void |
setMultiLingualObjectCache(ObservableHashtable<java.lang.String,MultiLingualObject> multiLingualObjectCache)
multiLingualObjectCache is a cache object which can be used by the data sources to store read MultiLingual Objects. |
java.lang.String |
toString()
|
org.jdom.Element |
translate(org.jdom.Element transUnit,
XmlDocument xliffDocument,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
java.util.Hashtable<java.lang.String,java.lang.String> translationParameters)
translate translates a trans-unit given the source language, target Language and match similarity |
static int |
translate(java.lang.String xliffFile,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.lang.String similarity,
java.lang.String hibernateConfigFile)
translate translates an xliff file based on an SQL data source |
void |
update(java.util.Observable arg0,
java.lang.Object arg1)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OpenTMSQLDataSource(DataSourceProperties dataModelProperties)
dataModelProperties - the properties of the model.| Method Detail |
|---|
public static boolean createDatabase(java.lang.String dbname,
java.lang.String hibernateConfigFile)
dbname - the database namehibernateConfigFile - hibernate configuraion file for the new database
public static boolean deleteDatabase(java.lang.String dbname,
java.lang.String hibernateConfigFile)
dbname - the database namehibernateConfigFile - hibernate configuraion file for the new database
public static int exportTmx(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
tmxFile - hibernateConfigFile -
public static int exportToMOL(java.lang.String hibernateConfigFile)
hibernateConfigFile -
public static int importTmxFile(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
tmxFile - hibernateConfigFile -
public static int importXliffFile(java.lang.String tmxFile,
java.lang.String hibernateConfigFile)
public static void main(java.lang.String[] args)
args -
public static int translate(java.lang.String xliffFile,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.lang.String similarity,
java.lang.String hibernateConfigFile)
xliffFile - the xliff file to translatesourceLanguage - the source language to translatetargetLanguage - the target language to translatesimilarity - the similarity to use (integer number)hibernateConfigFile - the sql data source configuartion file
public boolean addMonoLingualObject(MonoLingualObject monoLingualObject,
boolean mergeObjects)
DataSource
addMonoLingualObject in interface DataSourceaddMonoLingualObject in class BasicDataSourcemonoLingualObject - the MOL object to addmergeObjects - 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
public boolean addMultiLingualObject(MultiLingualObject multiLingualObject,
boolean mergeObjects)
DataSource
addMultiLingualObject in interface DataSourceaddMultiLingualObject in class BasicDataSourcemultiLingualObject - the object to addmergeObjects - 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
public void cleanDataSource()
DataSource
cleanDataSource in interface DataSourcecleanDataSource in class BasicDataSource
public boolean clearDataSource()
throws OpenTMSException
DataSource
clearDataSource in interface DataSourceclearDataSource in class BasicDataSourceOpenTMSException
public boolean createDataSource(DataSourceProperties dataModelProperties)
throws OpenTMSException
DataSource
createDataSource in interface DataSourcecreateDataSource in class BasicDataSourcedataModelProperties - the parameters of the data source
OpenTMSException
public boolean deleteDataSource(DataSourceProperties dataModelProperties)
throws OpenTMSException
DataSource
deleteDataSource in interface DataSourcedeleteDataSource in class BasicDataSourcedataModelProperties - the parameters of the data source
OpenTMSExceptionpublic int exportTmxFile(java.lang.String tmxFile)
DataSource
exportTmxFile in interface DataSourceexportTmxFile in class BasicDataSourcetmxFile - the tmx file to export to
public java.lang.String getDataSourceType()
DataSource
getDataSourceType in interface DataSourcegetDataSourceType in class BasicDataSourcepublic MonoLingualPartitionedFuzzyNodeTree getFuzzyTree()
public int getLastErrorCode()
BasicDataSource
getLastErrorCode in interface DataSourcegetLastErrorCode in class BasicDataSourcepublic ObservableHashtable<java.lang.String,MultiLingualObject> getMultiLingualObjectCache()
BasicDataSource
getMultiLingualObjectCache in class BasicDataSourcepublic int hashCode()
hashCode in class java.lang.Objectpublic int importTmxFile(java.lang.String tmxFile)
importTmxFile in interface DataSourceimportTmxFile in class BasicDataSourcetmxFile - the tmx file to import
public int importXliffFile(java.lang.String xliffFile)
DataSource
importXliffFile in interface DataSourceimportXliffFile in class BasicDataSourcexliffFile - the xliff file to import
public boolean isBLoadAttributesLazy()
DataSource
isBLoadAttributesLazy in interface DataSourceisBLoadAttributesLazy in class BasicDataSourcepublic void removeDataSource()
DataSource
removeDataSource in interface DataSourceremoveDataSource in class BasicDataSourcepublic boolean removeMonoLingualObject(MonoLingualObject monoLingualObject)
DataSource
removeMonoLingualObject in interface DataSourceremoveMonoLingualObject in class BasicDataSourcemonoLingualObject - the object to remove
public boolean removeMultiLingualObject(MultiLingualObject multiLingualObject)
DataSource
removeMultiLingualObject in interface DataSourceremoveMultiLingualObject in class BasicDataSourcemultiLingualObject - the object to remove
public java.util.Vector<MonoLingualObject> search(MonoLingualObject searchMonoLingualObject)
DataSource
search in interface DataSourcesearch in class BasicDataSourcesearchMonoLingualObject - the MonoLingualObject to search for
public void setBLoadAttributesLazy(boolean loadAttributesLazy)
DataSource
setBLoadAttributesLazy in interface DataSourcesetBLoadAttributesLazy in class BasicDataSourceloadAttributesLazy - the bLoadAttributesLazy to set; false = load at creation time; true load at time when neededpublic void setDataSourceType()
DataSource
setDataSourceType in interface DataSourcesetDataSourceType in class BasicDataSourcepublic void setFuzzyTree(MonoLingualPartitionedFuzzyNodeTree fuzzyTree)
fuzzyTree - the fuzzyTree to setpublic void setLastErrorCode(int lastErrorCode)
DataSource
setLastErrorCode in interface DataSourcesetLastErrorCode in class BasicDataSourcelastErrorCode - the lastErrorCode to setpublic void setMultiLingualObjectCache(ObservableHashtable<java.lang.String,MultiLingualObject> multiLingualObjectCache)
BasicDataSource
setMultiLingualObjectCache in class BasicDataSourcemultiLingualObjectCache - the multiLingualObjectCache to setpublic java.lang.String toString()
toString in class java.lang.Object
public org.jdom.Element translate(org.jdom.Element transUnit,
XmlDocument xliffDocument,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
int matchSimilarity,
java.util.Hashtable<java.lang.String,java.lang.String> translationParameters)
throws OpenTMSException
DataSource
translate in interface DataSourcetranslate in class BasicDataSourcetransUnit - the trans unit to translate to usexliffDocument - 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
OpenTMSException
public void update(java.util.Observable arg0,
java.lang.Object arg1)
update in interface java.util.Observerupdate in class BasicDataSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||