public class FilterUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADMIN_USERNAME |
static java.lang.String |
LOCALE_ATTRIBUTE |
static java.lang.String |
REMEMBER_ATTRIBUTE |
Constructor and Description |
---|
FilterUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getGlobalPropertyValue(java.lang.String globalPropertyName)
Gets the value of a global Property as a string from the database using sql, this method is
useful when you want to get a value of a global property before the application context has
been setup
|
static java.lang.Integer |
getUserIdByName(java.lang.String userNameOrSystemId,
java.sql.Connection connection)
This is a utility method that can be used for retrieving user id by given user name and sql
connection
|
static java.lang.String |
readSystemDefaultLocale(java.sql.Connection connection)
This method uses passed in connection to load system default locale.
|
static java.lang.String |
restoreLocale(java.lang.String username)
Tries to retrieve location parameter.
|
static boolean |
storeLocale(java.lang.String locale)
Stores selected by user locale into DB as admin's user property and as system default locale
|
public static final java.lang.String LOCALE_ATTRIBUTE
public static final java.lang.String REMEMBER_ATTRIBUTE
public static final java.lang.String ADMIN_USERNAME
public static java.lang.String restoreLocale(java.lang.String username)
username
- the name of the administrative user whose default locale property will be
restoredpublic static java.lang.String readSystemDefaultLocale(java.sql.Connection connection)
connection
- (optional) the jdbc connection to be used for extracting default localepublic static boolean storeLocale(java.lang.String locale)
locale
- the selected by user languagepublic static java.lang.Integer getUserIdByName(java.lang.String userNameOrSystemId, java.sql.Connection connection) throws java.sql.SQLException
userNameOrSystemId
- the name of userconnection
- the java sql connection to usejava.sql.SQLException
public static java.lang.String getGlobalPropertyValue(java.lang.String globalPropertyName)
globalPropertyName
- the name of the global propertyCopyright © 2018 OpenMRS Inc.. All Rights Reserved.