| 
 | OBEROn SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.oberon.ooql.sdk.Dictionary
public class Dictionary
Stores language translations on the database for application usage. The dictionary is subdivided into sections. Each section contains keyword translations for one or more languages. A dictionary keyword can have its own translation (for example the field label) and sub-keyword translations (for example the field range values)
| Field Summary | |
|---|---|
|  java.util.BitSet | bsOptions | 
| static int | KEYWORDList section keywords | 
| static int | LANGUAGEList defined languages | 
| static int | SECTIONList Dictionary sections | 
| static int | SUBKEYList keyword sub-keywords | 
| Constructor Summary | |
|---|---|
| Dictionary() | |
| Dictionary(java.lang.String language,
           java.lang.String section,
           java.lang.String key)New dictionary keyword element for the specified language and section | |
| Dictionary(java.lang.String language,
           java.lang.String section,
           java.lang.String key,
           java.lang.String subKey)New dictionary sub-keyword element for the specified language and section | |
| Method Summary | |
|---|---|
|  void | addKeyPattern(java.lang.String keyPattern)Add a dictionary keyword pattern for the translation extraction / import / removal. | 
|  void | check(boolean update,
      java.io.DataOutputStream logStream,
      Framework framework)Check if declared keyword / sub-keyword translations are present inside the dictionary | 
|  void | get(Framework framework)Read a keyword / sub-keyword translation from the database | 
|  java.lang.String | getKey()Get the settled dictionary keyword name | 
| static java.lang.String | getKey(java.lang.String key,
       Framework framework)Get a keyword translation for the default framework language | 
| static java.lang.String | getKey(java.lang.String section,
       java.lang.String key,
       Framework framework)Get a keyword translation for the default framework language from the specified section | 
| static java.lang.String | getKey(java.lang.String language,
       java.lang.String section,
       java.lang.String key,
       Framework framework)Get a keyword translation for the specified language and section | 
|  java.util.Vector<java.lang.String> | getKeyPatterns()Get the settled dictionary keyword patterns | 
|  java.lang.String | getLanguage()Get the settled dictionary language code. | 
|  int | getListOption()Return the list option | 
|  java.lang.String | getSection()Get the settled dictionary section name. | 
|  java.lang.String | getSeparatorToken()Get the settled separator token. | 
|  java.lang.String | getSubKey()Get the settled dictionary sub-keyword name | 
| static java.lang.String | getSubKey(java.lang.String key,
          java.lang.String subKey,
          Framework framework)Get a sub-keyword translations for the default framework language | 
| static java.lang.String | getSubKey(java.lang.String section,
          java.lang.String key,
          java.lang.String subKey,
          Framework framework)Get a sub-keyword translations for the default framework language from the specified section | 
| static java.lang.String | getSubKey(java.lang.String language,
          java.lang.String section,
          java.lang.String key,
          java.lang.String subKey,
          Framework framework)Get a sub-keyword translations for the specified language and section | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String key,
           Framework framework)Get the sub-keyword translations for the default framework language - search to all sections | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String section,
           java.lang.String key,
           Framework framework)Get the sub-keyword translations for the default framework language from the specified section | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String language,
           java.lang.String section,
           java.lang.String key,
           Framework framework)Get the sub-keyword translations for the specified language and section | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String language,
           java.lang.String section,
           java.lang.String key,
           java.util.Vector<java.lang.String> subKeys,
           Framework framework)Get the sub-keyword translations for the specified language and section | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String section,
           java.lang.String key,
           java.util.Vector<java.lang.String> subKeys,
           Framework framework)Get the sub-keyword translations for the default framework language from the specified section | 
| static java.util.Hashtable<java.lang.String,java.lang.String> | getSubKeys(java.lang.String key,
           java.util.Vector<java.lang.String> subKeys,
           Framework framework)Get the sub-keyword translations for the default framework language - search to all sections | 
| static java.util.Vector<java.lang.String> | getTranslations(java.lang.String section,
                java.lang.String key,
                Framework framework)Get the sub-keyword translations for the specified section | 
| static java.util.Vector<java.lang.String> | getTranslations(java.lang.String language,
                java.lang.String section,
                java.lang.String key,
                Framework framework)Get the sub-keyword translations for the specified language and section | 
|  java.lang.String | getValue()Get the dictionary keyword / sub-keyword translation. | 
|  void | importKeys(java.io.DataInputStream inStream,
           Framework framework)Import translations from a file to the database | 
|  boolean | isExcel()Check if translation import/export is in Excel mode | 
|  boolean | isJSON()Get the json flag | 
|  boolean | isXML()Check if translation import/export is in XML mode | 
|  void | list(Framework framework)List the dictionary keywords/sub-keywords using the settled filters (language,section..) | 
| static java.util.Vector<java.lang.String> | listSubKeys(java.lang.String key,
            Framework framework)List the sub-keyword names for a given keyword | 
| static java.util.Vector<java.lang.String> | listSubKeys(java.lang.String section,
            java.lang.String key,
            Framework framework)List the sub-keyword names for a given keyword and section | 
|  void | put(Framework framework)Save a keyword / sub-keyword translation to the database | 
|  void | removeKeys(Framework framework)Delete one or more keyword / sub-keyword translations from the dictionary | 
| static void | resetCache(Framework framework)Clean the dictionary cache | 
|  void | selectKeys(java.io.DataOutputStream outStream,
           Framework framework)Extract dictionary translations to a file, using the settled filters (language,section..) | 
| static java.lang.String | selectKeys(java.lang.String language,
           java.lang.String section,
           java.lang.String key,
           java.lang.String subKey,
           java.lang.String value,
           boolean xml,
           Framework framework)Extract the sub-keyword translations using language,section,key and subkey patterns | 
|  void | setExcel(boolean excel)Set the Excel flag for export/import translations in Excel format | 
|  void | setJSON(boolean json)Set the import / export file format in JSON format | 
|  void | setKey(java.lang.String key)Set the dictionary keyword name. | 
| static void | setKey(java.lang.String language,
       java.lang.String section,
       java.lang.String key,
       java.lang.String value,
       Framework framework)Add a keyword translation for the specified language and section | 
|  void | setLanguage(java.lang.String language)Set the dictionary language code. | 
|  void | setListOption(int listType)Set keyword extraction type; Must be used with the list method. | 
|  void | setSection(java.lang.String section)Set the dictionary section name. | 
|  void | setSeparatorToken(java.lang.String token)Set the separator token for the translation extraction. | 
|  void | setSubKey(java.lang.String subKey)Set the dictionary sub-keyword name. | 
| static void | setSubKey(java.lang.String language,
          java.lang.String section,
          java.lang.String key,
          java.lang.String subKey,
          java.lang.String value,
          Framework framework)Add a sun-keyword translation for the specified language and section | 
|  void | setValue(java.lang.String translation)Set the dictionary keyword / sub-keyword translation. | 
|  void | setXML(boolean xml)Set the xml flag for export/import translations in XML format | 
|  java.lang.String | toString()Return the settled parameters and values as a single String | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final int LANGUAGE
public static final int SECTION
public static final int KEYWORD
public static final int SUBKEY
public java.util.BitSet bsOptions
| Constructor Detail | 
|---|
public Dictionary()
public Dictionary(java.lang.String language,
                  java.lang.String section,
                  java.lang.String key)
language - the translation languagesection - the dictionary sectionkey - the keyword name
public Dictionary(java.lang.String language,
                  java.lang.String section,
                  java.lang.String key,
                  java.lang.String subKey)
language - the translation languagesection - the dictionary sectionkey - the keyword namesubKey - the sub-keyword name| Method Detail | 
|---|
public void put(Framework framework)
         throws OberonException
framework - the current framework
OberonException - usually due to DB SQL exceptions or to limited user access rights
public void importKeys(java.io.DataInputStream inStream,
                       Framework framework)
                throws java.io.IOException,
                       OberonException
inStream - the input data stream containing the translationsframework - the current framework
OberonException - usually due to DB SQL exceptions or to limited user access rights
java.io.IOException
public void get(Framework framework)
         throws OberonException
framework - the current framework
OberonException - usually due to DB SQL exceptions
public void list(Framework framework)
          throws OberonException
framework - the current framework
OberonException - usually due to DB SQL exceptions
public void selectKeys(java.io.DataOutputStream outStream,
                       Framework framework)
                throws java.io.IOException,
                       OberonException
outStream - the destination stream (if null extract to the framework result buffer)framework - the current framework
OberonException - usually due to DB SQL exceptions or IO exceptions
java.io.IOException
public void removeKeys(Framework framework)
                throws OberonException
framework - the current framework
OberonException - usually due to DB SQL exceptions or to limited user access rights
public void check(boolean update,
                  java.io.DataOutputStream logStream,
                  Framework framework)
           throws java.io.IOException,
                  OberonException
update - if true add missed keywords to dictionary sectionlogStream - the log file streamframework - the current framework
OberonException - usually due to DB SQL exceptions or to limited user access rights
java.io.IOExceptionpublic void setLanguage(java.lang.String language)
language - the dictionary language codepublic java.lang.String getLanguage()
public void setSection(java.lang.String section)
section - the dictionary section namepublic java.lang.String getSection()
public void setKey(java.lang.String key)
key - the dictionary keywordpublic java.lang.String getKey()
public void setSubKey(java.lang.String subKey)
subKey - the dictionary sub-keyword namepublic java.lang.String getSubKey()
public void setValue(java.lang.String translation)
translation - the dictionary translationpublic java.lang.String getValue()
public void addKeyPattern(java.lang.String keyPattern)
keyPattern - the dictionary keyword patternpublic java.util.Vector<java.lang.String> getKeyPatterns()
public void setSeparatorToken(java.lang.String token)
token - the separator tokenpublic java.lang.String getSeparatorToken()
setSeparatorToken(String)public void setXML(boolean xml)
public boolean isXML()
public void setJSON(boolean json)
json - true to set the JSON formatpublic boolean isJSON()
setJSON(boolean)public void setExcel(boolean excel)
public boolean isExcel()
public void setListOption(int listType)
listType - LANGUAGE (default) SECTION KEYWORD SUBKEYpublic int getListOption()
setListOption(int)
public static void setKey(java.lang.String language,
                          java.lang.String section,
                          java.lang.String key,
                          java.lang.String value,
                          Framework framework)
                   throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword namevalue - the dictionary translation valueframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getKey(java.lang.String key,
                                      Framework framework)
                               throws OberonException
key - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getKey(java.lang.String section,
                                      java.lang.String key,
                                      Framework framework)
                               throws OberonException
section - the dictionary sectionkey - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getKey(java.lang.String language,
                                      java.lang.String section,
                                      java.lang.String key,
                                      Framework framework)
                               throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static void setSubKey(java.lang.String language,
                             java.lang.String section,
                             java.lang.String key,
                             java.lang.String subKey,
                             java.lang.String value,
                             Framework framework)
                      throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword namesubKey - the sub-keyword namevalue - the dictionary translation valueframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getSubKey(java.lang.String key,
                                         java.lang.String subKey,
                                         Framework framework)
                                  throws OberonException
key - the keyword namesubKey - the sub-keywords (separated by comma)framework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getSubKey(java.lang.String section,
                                         java.lang.String key,
                                         java.lang.String subKey,
                                         Framework framework)
                                  throws OberonException
section - the dictionary sectionkey - the keyword namesubKey - the sub-keywords (separated by comma)framework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String getSubKey(java.lang.String language,
                                         java.lang.String section,
                                         java.lang.String key,
                                         java.lang.String subKey,
                                         Framework framework)
                                  throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword namesubKey - the sub-keywords (separated by comma)framework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String key,
                                                                                Framework framework)
                                                                         throws java.lang.Exception
key - the keyword nameframework - the current framework
java.lang.Exception - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String key,
                                                                                java.util.Vector<java.lang.String> subKeys,
                                                                                Framework framework)
                                                                         throws OberonException
key - the keyword namesubKeys - a vector of sub-keyword namesframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String section,
                                                                                java.lang.String key,
                                                                                Framework framework)
                                                                         throws java.lang.Exception
section - the dictionary sectionkey - the keyword nameframework - the current framework
java.lang.Exception - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String section,
                                                                                java.lang.String key,
                                                                                java.util.Vector<java.lang.String> subKeys,
                                                                                Framework framework)
                                                                         throws OberonException
section - the dictionary sectionkey - the keyword namesubKeys - a vector of sub-keyword namesframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String language,
                                                                                java.lang.String section,
                                                                                java.lang.String key,
                                                                                Framework framework)
                                                                         throws java.lang.Exception
language - the translation languagesection - the dictionary sectionkey - the keyword nameframework - the current framework
java.lang.Exception - usually due to DB SQL exceptions
public static java.util.Hashtable<java.lang.String,java.lang.String> getSubKeys(java.lang.String language,
                                                                                java.lang.String section,
                                                                                java.lang.String key,
                                                                                java.util.Vector<java.lang.String> subKeys,
                                                                                Framework framework)
                                                                         throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword namesubKeys - a vector of sub-keyword namesframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Vector<java.lang.String> listSubKeys(java.lang.String key,
                                                             Framework framework)
                                                      throws OberonException
key - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Vector<java.lang.String> listSubKeys(java.lang.String section,
                                                             java.lang.String key,
                                                             Framework framework)
                                                      throws OberonException
section - the dictionary sectionkey - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.lang.String selectKeys(java.lang.String language,
                                          java.lang.String section,
                                          java.lang.String key,
                                          java.lang.String subKey,
                                          java.lang.String value,
                                          boolean xml,
                                          Framework framework)
                                   throws OberonException
language - the dictionary language patternsection - the dictionary section patternkey - the keyword patternsubKey - the sub-key patternvalue - the translation patternxml - if true the result will be in xml formatframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Vector<java.lang.String> getTranslations(java.lang.String section,
                                                                 java.lang.String key,
                                                                 Framework framework)
                                                          throws OberonException
section - the dictionary sectionkey - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static java.util.Vector<java.lang.String> getTranslations(java.lang.String language,
                                                                 java.lang.String section,
                                                                 java.lang.String key,
                                                                 Framework framework)
                                                          throws OberonException
language - the translation languagesection - the dictionary sectionkey - the keyword nameframework - the current framework
OberonException - usually due to DB SQL exceptions
public static void resetCache(Framework framework)
                       throws OberonException
OberonExceptionpublic java.lang.String toString()
toString in class java.lang.Object| 
 | OBEROn SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||