Interface Methods

The methods exposed by ITmEngine interface are:
  • public abstract String getName();
    Returns the name of the engine instance.
  • public abstract String getType();
    Returns the ITmEngine type used for storing data. Possible values are:
    • MapDbEngine
    • SQLEngine
  • public abstract void close() throws IOException, SQLException;
    Closes the engine instance.
  • public abstract int storeTMX(String tmxFile, String project, String customer, 
                    String subject) throws SAXException, IOException, 
                    ParserConfigurationException, SQLException;
    Imports a TMX document located at "tmxFile" and associates its data with "project", "customer" and "subject" properties
  • public abstract void exportMemory(String tmxfile, Set<String> langs, String 
                    srcLang, Map<String, String> properties) throws IOException, 
                    SAXException, ParserConfigurationException, SQLException;
    Exports engine data to a TMX document located at "tmxfile".
    The "langs" argument may contain a set of language codes. If "langs" is not null, only the entries with the given language codes are exported.
    The "srcLang" argument indicates the source language assigned to the TMX file. It can be one of the languages from the data set (see "getAllLanguages()") or the string "*all*".
    The "properties" argument may contain a set of property-value pairs to be set in the exported TMX file.
  • public abstract void flag(String tuid) throws SQLException;
    Adds the property "x-flag" and sets its value to "SW-Flag" to the translation unit identified by the "tuid" argument.
  • public abstract Set<String> getAllLanguages() throws SQLException;
    Returns a collection containing all language codes used in the engine's data.
  • public abstract Set<String> getAllClients() throws SQLException;
    Returns a collection containing all values assigned to the "client" property.
  • public abstract Set<String> getAllProjects() throws SQLException;
    Returns a collection containing all values assigned to the "project" property.
  • public abstract Set<String> getAllSubjects() throws SQLException;
    Returns a collection containing all values assigned to the "subject" property.
  • public abstract List<Match> searchTranslation(String searchStr, String 
                    srcLang, String tgtLang, int similarity, boolean 
                    caseSensitive) throws IOException, SAXException, 
                    ParserConfigurationException, SQLException;
    Returns a list of possible translations of the "searchStr" argument.
    The search result is restricted to entries with the source language indicated by "srcLang" and target language indicated by "tgtLang" whose similarity to the given text is greater or equal to the value of the "similarity" argument.
    The "caseSensitive" argument indicates whether the search engine should consider letter case differences or not.
  • public abstract List<Element> concordanceSearch(String searchStr, 
                    String srcLang, int limit, boolean isRegexp, boolean 
                    caseSensitive) throws IOException, SAXException, 
                    ParserConfigurationException, SQLException;
    Returns a list of all translation units (<tu> elements) that contain the text indicated in "searchStr" argument.
    Searches are performed against the translation unit variant (<tuv> element) with language set to "srcLang".
    Search result contains at most "limit" entries. Returned data is in no particular order.
    Argument "isRegexp" indicates whether the "searchStr" parameter should be considered a regular expression that matches the whole segment.
    The "caseSensitive" argument indicates whether the search engine should consider letter case differences or not.
  • public abstract void storeTu(Element tu) throws IOException, SQLException;
    Stores translation unit "tu" into the database, overwriting any existing <tu> element with the same "id" attribute.
  • public abstract void commit() throws SQLException;
    Flushes to disk any data held in memory and not written yet.
  • public abstract Element getTu(String tuid) throws IOException, 
                    SAXException, ParserConfigurationException, SQLException;
    Returns the translation unit (<tu> element) that has the "id" attribute set to the "tuid" argument.
  • public abstract void removeTu(String tuid) throws IOException, SAXException, 
                    ParserConfigurationException, SQLException;
    Removes from the database the <tu> element that has the "id" attribute set to the "tuid" argument.
  • public abstract void deleteDatabase() throws IOException, SQLException; 
    • When used with "MapDbEngine" instances, closes the engine and removes all associated files from disk;
    • When used with "SQLEngine" instances, closes the engine and drops the associated database from the SQL server.