public class DBLanguages
extends java.lang.Object
Display static tables as HTML elements like <SELECT>.
This class is a singleton memory cache for frequently accessed static tables.Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
SupportedLanguages
Array of language identifiers supported by the database
|
Constructor and Description |
---|
DBLanguages() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sGuOwner,
java.lang.String sIdSection,
boolean bActive,
java.lang.String sVlLookUp,
java.lang.String sTpLookUp,
java.lang.String sTxComments,
java.util.HashMap<java.lang.String,java.lang.String> oTranslatMap)
Add a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.
|
static boolean |
addLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sGuOwner,
java.lang.String sIdSection,
java.lang.String sVlLookUp,
java.util.HashMap<java.lang.String,java.lang.String> oTranslatMap)
Add a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.
|
static void |
deleteLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sBaseTable,
java.lang.String sGuOwner,
java.lang.String sIdSection,
int iPgLookUp)
Delete lookup value
|
static void |
deleteLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sBaseTable,
java.lang.String sGuOwner,
java.lang.String sIdSection,
java.lang.String sVlLookUp)
Delete lookup value
|
java.lang.String |
getCountryName(JDCConnection oConn,
java.lang.String sCountryId,
java.lang.String sIdLanguage)
Get country translated name given its 2 letter ISO code.
|
java.lang.String |
getHTMLCountrySelect(JDCConnection oConn,
java.lang.String sIdLanguage)
Get an HTML ComboBox with a list of all languages at k_lu_countries.
|
static java.lang.String |
getHTMLSelectLookUp(DistributedCachePeer oCache,
JDCConnection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage)
Get an HTML ComboBox options with translated labels for a standard
hipergate lookup table.
|
static java.lang.String |
getHTMLSelectLookUp(DistributedCachePeer oCache,
JDCConnection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage,
int iOrderBy)
Get an HTML ComboBox options with translated labels for a standard
hipergate lookup table.
|
static java.lang.String |
getHTMLSelectLookUp(JDCConnection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage)
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
|
static java.lang.String |
getHTMLSelectLookUp(JDCConnection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage,
java.lang.String sDefaultValue)
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
|
java.lang.String |
getHTMLStateSelect(JDCConnection oConn,
java.lang.String sCountryId,
java.lang.String sIdLanguage)
Get list of states for a country in HTML SELECT format
|
java.lang.String |
getHTMLTermSelect(JDCConnection oConn,
int iIdDomain,
java.lang.String sGuWorkArea)
Get list of thesauri terms for a given Domain and WorkArea
|
java.lang.String |
getHTMLTermSelect(JDCConnection oConn,
int iIdDomain,
java.lang.String sGuWorkArea,
java.lang.String sScope)
Get list of thesauri terms for a given Domain WorkArea and Scope
|
static java.util.HashMap |
getLanguageLookUpMap(java.sql.Connection oConn,
java.lang.String sLanguage)
Get a Map of language lookup talbe values and their corresponding translated labels for a language.
|
java.lang.String |
getLanguageName(JDCConnection oConn,
java.lang.String sLanguageId,
java.lang.String sIdLanguage)
Get language translated name given its 2 letter ISO code.
|
static java.util.HashMap |
getLookUpMap(java.sql.Connection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage)
Get a Map of lookup values and their corresponding translated labels for a language.
|
static java.lang.String |
getLookUpTranslation(java.sql.Connection oConn,
java.lang.String sTableName,
java.lang.String sOwnerId,
java.lang.String sSectionId,
java.lang.String sLanguage,
java.lang.String sLookupId)
Get a translated label for a lookup value.
|
static java.lang.String |
getLookupTranslationsColumnList()
A comma separated list of column names for translated labels of lookup tables
|
java.lang.String |
getPlainTextStateList(JDCConnection oConn,
java.lang.String sCountryId,
java.lang.String sIdLanguage)
Get list of states for a country in plain text format
|
static int |
nextLookuUpProgressive(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sGuOwner,
java.lang.String sIdSection)
Find value of next unused lookup index for a given table section
|
static void |
storeLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sGuOwner,
java.lang.String sIdSection,
boolean bActive,
java.lang.String sVlLookUp,
java.lang.String sTpLookUp,
java.lang.String sTxComments,
java.util.HashMap oTranslations)
Add or update a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.
|
static void |
storeLookup(java.sql.Connection oConn,
java.lang.String sLookupTableName,
java.lang.String sGuOwner,
java.lang.String sIdSection,
java.lang.String sVlLookUp,
java.util.HashMap oTranslations)
Add or update a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.
|
java.lang.String |
toHTMLSelect(JDCConnection oConn,
java.lang.String sIdLanguage)
Get an HTML ComboBox with a list of all languages available at table k_lu_languages.
|
public static final java.lang.String[] SupportedLanguages
public static java.lang.String getLookupTranslationsColumnList()
A comma separated list of column names for translated labels of lookup tables
public java.lang.String toHTMLSelect(JDCConnection oConn, java.lang.String sIdLanguage) throws java.sql.SQLException
Get an HTML ComboBox with a list of all languages available at table k_lu_languages.
Language names are written in the language passed as parameter.oConn
- Database ConnectionsIdLanguage
- 2 chraracters code of language for displaying <OPTION> texts.public java.lang.String getHTMLCountrySelect(JDCConnection oConn, java.lang.String sIdLanguage) throws java.sql.SQLException
Get an HTML ComboBox with a list of all languages at k_lu_countries.
Country names are written in the language passed as parameter.oConn
- Database ConnectionsIdLanguage
- 2 chraracters code of language for displaying <OPTION> texts.public java.lang.String getCountryName(JDCConnection oConn, java.lang.String sCountryId, java.lang.String sIdLanguage) throws java.sql.SQLException
Get country translated name given its 2 letter ISO code.
oConn
- Database ConnectionsCountryId
- 2 characters code of country as at k_lu_countries tablesIdLanguage
- 2 characters code of derired language for displayingjava.sql.SQLException
public java.lang.String getLanguageName(JDCConnection oConn, java.lang.String sLanguageId, java.lang.String sIdLanguage) throws java.sql.SQLException
Get language translated name given its 2 letter ISO code.
oConn
- Database ConnectionsLanguageId
- 2 characters code of country as at k_lu_languages tablesIdLanguage
- 2 characters code of derired language for displayingjava.sql.SQLException
public java.lang.String getHTMLTermSelect(JDCConnection oConn, int iIdDomain, java.lang.String sGuWorkArea) throws java.sql.SQLException
oConn
- JDCConnectioniIdDomain
- int Domain Unique IdentifiersGuWorkArea
- String WorkArea GUIDpublic java.lang.String getHTMLTermSelect(JDCConnection oConn, int iIdDomain, java.lang.String sGuWorkArea, java.lang.String sScope) throws java.sql.SQLException
oConn
- JDCConnectioniIdDomain
- int Domain Unique IdentifiersGuWorkArea
- String WorkArea GUIDpublic java.lang.String getHTMLStateSelect(JDCConnection oConn, java.lang.String sCountryId, java.lang.String sIdLanguage) throws java.sql.SQLException
oConn
- JDCConnectionsCountryId
- 2 letters ISO country code (from k_lu_countries table)sIdLanguage
- 2 letters ISO language code (from k_lu_languages table)public java.lang.String getPlainTextStateList(JDCConnection oConn, java.lang.String sCountryId, java.lang.String sIdLanguage) throws java.sql.SQLException
oConn
- JDCConnectionsCountryId
- 2 letters ISO country code (from k_lu_countries table)sIdLanguage
- 2 letters ISO language code (from k_lu_languages table)java.sql.SQLException
public static java.lang.String getHTMLSelectLookUp(JDCConnection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage, java.lang.String sDefaultValue) throws java.sql.SQLException
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
This method goes directly to database without any intermediate cache or temporary storage object.oConn
- Database connectionsTableName
- Lookup table namesOwnerId
- WorkArea for filtering resultssSectionId
- Name of section (field) to retrievesDefaultValue
- Default selected value, if null then there is no defaultsLanguage
- 2 chracters language code for ComboBox texts (see k_lu_languages table)java.sql.SQLException
public static java.lang.String getHTMLSelectLookUp(JDCConnection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage) throws java.sql.SQLException
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
This method goes directly to database without any intermediate cache or temporary storage object.oConn
- Database connectionsTableName
- Lookup table namesOwnerId
- WorkArea for filtering resultssSectionId
- Name of section (field) to retrievesLanguage
- 2 chracters language code for ComboBox texts (see k_lu_languages table)java.sql.SQLException
public static java.lang.String getHTMLSelectLookUp(DistributedCachePeer oCache, JDCConnection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage, int iOrderBy) throws java.rmi.RemoteException, java.sql.SQLException
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
This method first checks the DistributedCachePeer for a matching ResultSet, then goes to database if ResultSet is not cached. Result is placed at cache as a DBSubset object with key sTableName.sSectionId[sOwnerId].oCache
- Local cache peeroConn
- Database connectionsTableName
- Lookup table namesOwnerId
- WorkArea for filtering resultssSectionId
- Name of section (field) to retrievesLanguage
- 2 chracters language code for ComboBox texts (see k_lu_languages table)iOrderBy
- Column for ordering results: 0=Internal Lookup Value, 1=Displayed Label, 2=Lookup Ordinaljava.sql.SQLException
java.rmi.RemoteException
DistributedCachePeer
public static java.lang.String getHTMLSelectLookUp(DistributedCachePeer oCache, JDCConnection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage) throws java.rmi.RemoteException, java.sql.SQLException
Get an HTML ComboBox options with translated labels for a standard hipergate lookup table.
This method first checks the DistributedCachePeer for a matching ResultSet, then goes to database if ResultSet is not cached. Result is placed at cache as a DBSubset object with key sTableName.sSectionId[sOwnerId].oCache
- Local cache peeroConn
- Database connectionsTableName
- Lookup table namesOwnerId
- WorkArea for filtering resultssSectionId
- Name of section (field) to retrievesLanguage
- 2 chracters language code for ComboBox texts (see k_lu_languages table)java.sql.SQLException
java.rmi.RemoteException
DistributedCachePeer
public static java.lang.String getLookUpTranslation(java.sql.Connection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage, java.lang.String sLookupId) throws java.sql.SQLException
Get a translated label for a lookup value.
oConn
- Database ConnectionsTableName
- Lookup table namesOwnerId
- WorkArea GUIDsSectionId
- Section name (field)sLanguage
- Language code for retrieved labelsLookupId
- Lookup value to findjava.sql.SQLException
public static java.util.HashMap getLookUpMap(java.sql.Connection oConn, java.lang.String sTableName, java.lang.String sOwnerId, java.lang.String sSectionId, java.lang.String sLanguage) throws java.sql.SQLException
Get a Map of lookup values and their corresponding translated labels for a language.
This method is to be used when a listing routine has to lookup several values at a base table for their translated lookup labels. Instead of joining the base table and the lookup table, a memory map may be fetched first and then the painting routine translates each value into its labels without any database access.oConn
- Database connectionsTableName
- Lookup table namesOwnerId
- WorkArea GUIDsSectionId
- Section name (field)sLanguage
- Language code for retrieved labelsjava.sql.SQLException
public static java.util.HashMap getLanguageLookUpMap(java.sql.Connection oConn, java.lang.String sLanguage) throws java.sql.SQLException
Get a Map of language lookup talbe values and their corresponding translated labels for a language.
This method is to be used when a listing routine has to lookup several values at language lookup table for their translated lookup labels. Instead of joining the base table and the language lookup table, a memory map may be fetched first and then the painting routine translates each value into its labels without any database access.oConn
- Database connectionsLanguage
- Language code for retrieved labelsjava.sql.SQLException
public static int nextLookuUpProgressive(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sGuOwner, java.lang.String sIdSection) throws java.sql.SQLException
oConn
- Connection Opened JDBC database connectionsLookupTableName
- String Look up table name (ex. k_companies_lookup)sGuOwner
- String GUID of WorkArea to which the new lookup value will belongsIdSection
- String Name of section (usually corresponding column name at base table)java.sql.SQLException
public static boolean addLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sGuOwner, java.lang.String sIdSection, java.lang.String sVlLookUp, java.util.HashMap<java.lang.String,java.lang.String> oTranslatMap) throws java.sql.SQLException
Add a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.oConn
- JDCConnectionsLookupTableName
- String Name of Lookup TablesGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section namesVlLookUp
- String Lookup Internal ValueoTranslatMap
- HashMap with one entry for each language.
Language codes must be those from id_language column of k_lu_languages table.java.sql.SQLException
public static boolean addLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sGuOwner, java.lang.String sIdSection, boolean bActive, java.lang.String sVlLookUp, java.lang.String sTpLookUp, java.lang.String sTxComments, java.util.HashMap<java.lang.String,java.lang.String> oTranslatMap) throws java.sql.SQLException
Add a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.oConn
- JDCConnectionsLookupTableName
- String Name of Lookup TablesGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section namesVlLookUp
- String Lookup Internal ValueoTranslatMap
- HashMap with one entry for each language.
Language codes must be those from id_language column of k_lu_languages table.java.sql.SQLException
public static void storeLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sGuOwner, java.lang.String sIdSection, java.lang.String sVlLookUp, java.util.HashMap oTranslations) throws java.sql.SQLException
Add or update a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.oConn
- JDCConnectionsLookupTableName
- String Name of Lookup TablesGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section namesVlLookUp
- String Lookup Internal ValueoTranslations
- HashMap with one entry for each language.
Language codes must be those from id_language column of k_lu_languages table.java.sql.SQLException
public static void storeLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sGuOwner, java.lang.String sIdSection, boolean bActive, java.lang.String sVlLookUp, java.lang.String sTpLookUp, java.lang.String sTxComments, java.util.HashMap oTranslations) throws java.sql.SQLException
Add or update a lookup value for a given section
This methods checks whether the lookup value exists and, if not, then inserts it.oConn
- JDCConnectionsLookupTableName
- String Name of Lookup TablesGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section namesVlLookUp
- String Lookup Internal ValueoTranslations
- HashMap with one entry for each language.
Language codes must be those from id_language column of k_lu_languages table.java.sql.SQLException
public static void deleteLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sBaseTable, java.lang.String sGuOwner, java.lang.String sIdSection, java.lang.String sVlLookUp) throws java.sql.SQLException
oConn
- ConnectionsLookupTableName
- String Name of Lookup TablesBaseTable
- String Base table which column named like sIdSection will be set to nullsGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section namesVlLookUp
- String Lookup Internal Valuejava.sql.SQLException
public static void deleteLookup(java.sql.Connection oConn, java.lang.String sLookupTableName, java.lang.String sBaseTable, java.lang.String sGuOwner, java.lang.String sIdSection, int iPgLookUp) throws java.sql.SQLException
oConn
- ConnectionsLookupTableName
- String Name of Lookup TablesBaseTable
- String Base table which column named like sIdSection will be set to nullsGuOwner
- String GUID of Owner WorkAreasIdSection
- String Lookup Section nameiPgLookUp
- int Lookup Ordinal Valuejava.sql.SQLException