oracle.i18n.servlet.localesource
Class DBLocaleSource

The DBLocaleSource class is the predefined database locale source that accesses a user profile table including user locale preferences. All user profile information can be specified in the GDK application configuration file. Default caching : This locale source is cached in the session by default

The database locale source should use the special tag <db-locale-source> to include the user profile information in the list of the locale determination rule. The following attributes are required:

data-source-name: the data source name that must be included in the data source definition file. For example, data-sources.xml is used for the data source in OC4J. All authentication information should be included in the data sources.

locale-source-table: the user schema table that includes the user locale preference.

user-column: the user name column in the user schema table. Usually, it is the column for user ID, such as e-mail address, login name, etc.

user-key: the name of the key used in the session object in the JSP/Java Servlet application. The GDK references the value associated with this key in the session object to check if the user is authenticated or not. If the value is not null, it is used to match the value in the user-column to find the user's locale preference, otherwise the GDK assumes no user is authenticated.

The attributes for the locale must be specified in one of the following parameters depending on the scenario:

Scenario 1: If the user locale preference is stored in the form of ISO locale, use:

locale-column: the column that includes the ISO locale

Scenario 2: If the user locale preference is stored in the form of Oracle language and Oracle territory names, use:

language-column: the column that includes the Oracle language name. This takes precedence over the value in locale-column.

territory-column: the column that includes the Oracle territory name. This takes precedence over the value in locale-column.

Scenario 3: If the user locale preference is stored in the form of Oracle abbreviation language and territory names, use:

short-language-name: the column that includes the abbreviation of the Oracle language name. If both language-column and short-language-name are specified, language-column takes precedence.

territory-column: the column that includes the Oracle territory name. This takes precedence over the value in locale-column.

Additionally, the following attributes may need to be specified:

charset-column: the column that includes the Oracle character set for the client. Note this is not the page character set information.

timezone-column: the column that includes the time zone ID.

linguistic-sort-column: the column that includes the Oracle linguistic sorting name.

date-format-column: the column that includes the short date format mask.

long-date-format-column: the column that includes the long date format mask.

time-format-column: the column that includes the time format mask.

date-time-format-column: the column that includes the short date and time format mask.

long-date-time-format-column: the column that includes the long date and time format mask.

number-format-column: the column that includes the number format mask.

currency-format-column: the column that includes the currency format mask.

writing-direction-column: the column that includes the writing direction, either LTR or RTL.

iso-currency-column: the column that includes the ISO 4217 currency ID.

For example, assuming the user locale and time zone preferences are used for globalized operations, the user schema table is specified as follows:

Also, the application provides the authentication filter that specifies "userinfo" to either the user id or null in the session object so that the database locale source object can determine if the user is authenticated or not.