Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.hipergate.translator
Class Translate

    java.lang.Object
      com.knowgate.hipergate.translator.Translate

    public class Translate

extends java.lang.Object

Robot for translating text files using k_translations table

Constructor Summary
`Translate()`
`Translate(java.lang.String sAuthUsr, java.lang.String sAuthStr, java.lang.String sRealm, java.lang.String sHost)`

Method Summary
`java.util.List` | `extensions()`
`java.util.HashMap` | `extractTagsFromFile(java.lang.String sSourceBase, java.lang.String sSourceDir, java.lang.String sSourceFile)` Create a Map with all the translatable literals found at a given file
`void` | `loadTranslationsForFile(java.lang.String sDrv, java.lang.String sUrl, java.lang.String sUsr, java.lang.String sPwd, java.lang.String sLng, java.lang.String sDir, java.lang.String sFle, java.lang.String sCnf)` This routine is currently unstable and must not be used
`static void` | `main(java.lang.String[] args)` Command line interface
`void` | `translateDirectory(java.lang.String sDrv, java.lang.String sUrl, java.lang.String sUsr, java.lang.String sPwd, java.lang.String sLng, java.lang.String sCnf, java.lang.String sSourceBase, java.lang.String sSourceDir, java.lang.String sTargetBase, java.lang.String sTargetDir)` Read files from a source directory and all its subdirectories and write translated versions for them
`void` | `translateFile(java.lang.String sDrv, java.lang.String sUrl, java.lang.String sUsr, java.lang.String sPwd, java.lang.String sLng, java.lang.String sDir, java.lang.String sFle, java.lang.String sCnf, java.lang.String sSourceBase, java.lang.String sSourceDir, java.lang.String sSourceFile, java.lang.String sTargetBase, java.lang.String sTargetDir, java.lang.String sTargetFile)` Read a source file and write a translated version for it
`void` | `writeTagsFromDirectory(java.lang.String sSourceBase, java.lang.String sSourceDir, java.lang.String sDrv, java.lang.String sUrl, java.lang.String sUsr, java.lang.String sPwd, java.lang.String sCnf)`
`void` | `writeTagsToDatabase(java.util.HashMap oTagMap, java.lang.String sDrv, java.lang.String sUrl, java.lang.String sUsr, java.lang.String sPwd, java.lang.String sDir, java.lang.String sFle, java.lang.String sCnf)` Write a tag map extracted from a file to the database

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Translate

    public Translate()

### Translate

    public Translate(java.lang.String sAuthUsr,
                     java.lang.String sAuthStr,
                     java.lang.String sRealm,
                     java.lang.String sHost)

Method Detail

### extensions

    public java.util.List extensions()

  Returns:
    List of translatable file extensions

### loadTranslationsForFile

    public void loadTranslationsForFile(java.lang.String sDrv,
                                        java.lang.String sUrl,
                                        java.lang.String sUsr,
                                        java.lang.String sPwd,
                                        java.lang.String sLng,
                                        java.lang.String sDir,
                                        java.lang.String sFle,
                                        java.lang.String sCnf)
                                 throws java.sql.SQLException,
                                        java.lang.ClassNotFoundException,
                                        java.io.IOException,
                                        java.io.FileNotFoundException

  This routine is currently unstable and must not be used

  Throws:
    `java.sql.SQLException`
    `java.lang.ClassNotFoundException`
    `java.io.IOException`
    `java.io.FileNotFoundException`

### extractTagsFromFile

    public java.util.HashMap extractTagsFromFile(java.lang.String sSourceBase,
                                                 java.lang.String sSourceDir,
                                                 java.lang.String sSourceFile)
                                          throws java.net.MalformedURLException,
                                                 com.enterprisedt.net.ftp.FTPException,
                                                 java.io.FileNotFoundException,
                                                 java.io.IOException

  Create a Map with all the translatable literals found at a given file

  Parameters:
    `sSourceBase` - Source base directory
    `sSourceDir` - Source subdirectory
    `sSourceFile` - Source file name with extension
  Throws:
    `java.net.MalformedURLException`
    `com.enterprisedt.net.ftp.FTPException`
    `java.io.FileNotFoundException`
    `java.io.IOException`

### writeTagsToDatabase

    public void writeTagsToDatabase(java.util.HashMap oTagMap,
                                    java.lang.String sDrv,
                                    java.lang.String sUrl,
                                    java.lang.String sUsr,
                                    java.lang.String sPwd,
                                    java.lang.String sDir,
                                    java.lang.String sFle,
                                    java.lang.String sCnf)
                             throws java.net.MalformedURLException,
                                    java.sql.SQLException,
                                    java.lang.ClassNotFoundException,
                                    java.io.FileNotFoundException,
                                    java.io.IOException

  Write a tag map extracted from a file to the database

  Parameters:
    `oTagMap` - The Map to be written.
    `sDrv` - Name of class for database drive, for example oracle.jdbc.driver.OracleDriver or com.knowgate.http.HttpDataObjsServlet if the database will be accessed throught an HttpDataObjsServlet HTTP bridge
    `sUrl` - Database connection string (like jdbc:oracle:thin:@localhost:1521:XE) or full HTTP URL to HttpDataObjsServlet servlet.
    `sUsr` - Database user name.
    `sPwd` - Database user password.
    `sDir` - Directory where file which tags are to be written is located.
    `sFle` - File name.
    `sCnf` - Profile name. If null or "" then "hipergate" is the default.
  Throws:
    `java.net.MalformedURLException`
    `java.sql.SQLException`
    `java.lang.ClassNotFoundException`
    `java.io.FileNotFoundException`
    `java.io.IOException`

### writeTagsFromDirectory

    public void writeTagsFromDirectory(java.lang.String sSourceBase,
                                       java.lang.String sSourceDir,
                                       java.lang.String sDrv,
                                       java.lang.String sUrl,
                                       java.lang.String sUsr,
                                       java.lang.String sPwd,
                                       java.lang.String sCnf)
                                throws java.io.IOException,
                                       java.sql.SQLException,
                                       java.lang.ClassNotFoundException,
                                       com.enterprisedt.net.ftp.FTPException

  Throws:
    `java.io.IOException`
    `java.sql.SQLException`
    `java.lang.ClassNotFoundException`
    `com.enterprisedt.net.ftp.FTPException`

### translateFile

    public void translateFile(java.lang.String sDrv,
                              java.lang.String sUrl,
                              java.lang.String sUsr,
                              java.lang.String sPwd,
                              java.lang.String sLng,
                              java.lang.String sDir,
                              java.lang.String sFle,
                              java.lang.String sCnf,
                              java.lang.String sSourceBase,
                              java.lang.String sSourceDir,
                              java.lang.String sSourceFile,
                              java.lang.String sTargetBase,
                              java.lang.String sTargetDir,
                              java.lang.String sTargetFile)
                       throws java.sql.SQLException,
                              java.io.IOException,
                              java.io.FileNotFoundException,
                              java.lang.ClassNotFoundException,
                              com.enterprisedt.net.ftp.FTPException

  Read a source file and write a translated version for it

  Parameters:
    `sDrv` - Name of class for database drive, for example oracle.jdbc.driver.OracleDriver or com.knowgate.http.HttpDataObjsServlet if the database will be accessed throught an HttpDataObjsServlet HTTP bridge
    `sUrl` - Database connection string (like jdbc:oracle:thin:@localhost:1521:XE) or full HTTP URL to HttpDataObjsServlet servlet.
    `sUsr` - Database user name.
    `sPwd` - Database user password.
    `sLng` - Two letter lowercase ISO code of target language.
    `sDir` -
    `sFle` -
    `sSourceBase` -
    `sSourceDir` -
    `sSourceFile` -
    `sTargetBase` -
    `sTargetDir` -
    `sTargetFile` -
  Throws:
    `java.sql.SQLException`
    `java.io.IOException`
    `java.io.FileNotFoundException`
    `java.lang.ClassNotFoundException`
    `com.enterprisedt.net.ftp.FTPException`

### translateDirectory

    public void translateDirectory(java.lang.String sDrv,
                                   java.lang.String sUrl,
                                   java.lang.String sUsr,
                                   java.lang.String sPwd,
                                   java.lang.String sLng,
                                   java.lang.String sCnf,
                                   java.lang.String sSourceBase,
                                   java.lang.String sSourceDir,
                                   java.lang.String sTargetBase,
                                   java.lang.String sTargetDir)
                            throws java.sql.SQLException,
                                   java.io.IOException,
                                   java.io.FileNotFoundException,
                                   java.lang.ClassNotFoundException,
                                   com.enterprisedt.net.ftp.FTPException

  Read files from a source directory and all its subdirectories and write translated versions for them

  Throws:
    `java.sql.SQLException`
    `java.io.IOException`
    `java.io.FileNotFoundException`
    `java.lang.ClassNotFoundException`
    `com.enterprisedt.net.ftp.FTPException`

### main

    public static void main(java.lang.String[] args)
                     throws java.io.FileNotFoundException,
                            java.io.IOException,
                            java.sql.SQLException,
                            java.lang.ClassNotFoundException,
                            com.enterprisedt.net.ftp.FTPException,
                            java.lang.StringIndexOutOfBoundsException

  Command line interface

  Parameters:
    `args` - The first parameter must be either extract or translate. The second parameter is the full path to a properties file containing Database connections parameters and source and target directories.
  Throws:
    `java.io.FileNotFoundException`
    `java.io.IOException`
    `java.sql.SQLException`
    `com.enterprisedt.net.ftp.FTPException`
    `java.lang.ClassNotFoundException`
    `java.lang.StringIndexOutOfBoundsException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD