|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConfigurationLoader
Interface for all configuration loaders.
The default implementation is the StandardConfigurationLoader class
but it can be replaced by another class that implements this interface thanks
to the DatatablesConfigurator.
| Field Summary | |
|---|---|
static String |
DEFAULT_GROUP_NAME
|
static String |
DT_DEFAULT_PROPERTIES
|
static String |
DT_USER_PROPERTIES
|
static String |
DT_USER_PROPERTIES_LOCATION
|
static String |
I18N_LOCALE_RESOLVER
|
static String |
I18N_MESSAGE_RESOLVER
|
static String |
STANDALONE_BUNDLES_TO_EXCLUDE
|
| Method Summary | |
|---|---|
Properties |
loadDefaultConfiguration()
Load the default configuration from the internal properties file and both: stores the properties inside a class field returns the properties if they need to be used outside of the class |
Properties |
loadUserConfiguration(Locale locale)
Load the user configuration which can be localized thanks to the given locale. |
void |
resolveConfigurations(Map<String,Map<ConfigToken<?>,Object>> map,
Locale locale,
javax.servlet.http.HttpServletRequest request)
Resolve configuration groups for the given locale. |
Set<String> |
resolveGroups(Locale locale)
Return a set containing all configuration groups. |
| Field Detail |
|---|
static final String DT_DEFAULT_PROPERTIES
static final String DT_USER_PROPERTIES_LOCATION
static final String DT_USER_PROPERTIES
static final String DEFAULT_GROUP_NAME
static final String STANDALONE_BUNDLES_TO_EXCLUDE
static final String I18N_LOCALE_RESOLVER
static final String I18N_MESSAGE_RESOLVER
| Method Detail |
|---|
Properties loadDefaultConfiguration()
Load the default configuration from the internal properties file and both:
Properties loadUserConfiguration(Locale locale)
Load the user configuration which can be localized thanks to the given locale.
Once the bundle loaded, it is converted into Properties.
locale - The current locale used to load the right properties file.
Set<String> resolveGroups(Locale locale)
Return a set containing all configuration groups.
Note that the i18n.locale.resolver is a special property
that must not be taken into account because it is group-independent.
locale - The current locale.
void resolveConfigurations(Map<String,Map<ConfigToken<?>,Object>> map,
Locale locale,
javax.servlet.http.HttpServletRequest request)
Resolve configuration groups for the given locale.
The default properties file (datatables-default.properties) already contains the 'global' group: this is the group of configuration that is used for all tables in the application.
Inside the user properties files (datatables_XX.properties), users can:
global.
For example, if the user properties file contains:
group1.i18n.msg.search=My label
group1.i18n.msg.processing=My other label
the ConfigurationLoader must create a group called 'group1'
containing all properties present in the 'global' group but where
i18n.msg.search and i18n.msg.processing are
overriden with the user's ones.
Note that:
map - The map to update after the resolution of the configuration
groups.locale - The current locale used to get the right properties file from
the resource bundle.request - The request sent by the browser.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||