Interface ResourceBundleService
public interface ResourceBundleService
May 7, 2004
- Version:
- $Id: ResourceBundleService.java 5799 2006-05-28 17:55:42Z geaz $ This class is used to manage the Resoucebunlde. It should work like the java.util.ResourceBundle class except that the properties file can be in the database or a a directory. The class java.util.ResourceBundle require that the properties file has to be in the classpath.
- Author:
- Tuan Nguyen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThis method is acted as a factory oforg.exoplatform.commons.utils.PageList<ResourceBundleData> This method search and return a page description iteratorgetResourceBundle(String[] name, Locale locale) This method will call the method public ResourceBundle getResourceBundle(String[] name, Locale locale, ClassLoader cl) and using the the classloader of the current threadgetResourceBundle(String[] name, Locale locale, ClassLoader cl) This method will look for all the resources with the given names and merge into one resource bundle, the properties in the later resource bundle name will have the higher priority than the previous one.getResourceBundle(String name, Locale locale) This method should search for a template in the database that the service manage or the resource in the classpath of the current thread class loadergetResourceBundle(String name, Locale locale, ClassLoader cl) This method should search for a template in the database that the service manage or the resource in the classpath of the specified class loaderdefault StringgetResourceBundleContent(String resourceBundleName, Locale locale) Return resource bundle contentThis method should look for a resource bundle in the database that match the given id.String[]The developer can store the common properties in certain resource bundles so later he can merge a resource bundle with the shared resource bunldesdefault StringgetSharedString(String key, Locale locale) This method remove the data record in the databas and return the data instance after it has been removedvoidThis method shoudl create or update a ResourceBundleData instance
-
Field Details
-
DEFAULT_CROWDIN_LOCALE
Default Crowdin language different from default platform language -
DEFAULT_CROWDIN_LANGUAGE
-
-
Method Details
-
getResourceBundle
This method should search for a template in the database that the service manage or the resource in the classpath of the current thread class loader- Parameters:
name- The name of the resource bunldelocale- the locale- Returns:
- A ResourceBunlde or null if no ResourceBundle is found
-
getResourceBundle
This method should search for a template in the database that the service manage or the resource in the classpath of the specified class loader- Parameters:
name- the name of the resourcelocale- the localecl- The classloader- Returns:
-
getResourceBundle
This method will call the method public ResourceBundle getResourceBundle(String[] name, Locale locale, ClassLoader cl) and using the the classloader of the current thread -
getResourceBundle
This method will look for all the resources with the given names and merge into one resource bundle, the properties in the later resource bundle name will have the higher priority than the previous one. -
getResourceBundleData
This method should look for a resource bundle in the database that match the given id. The ResourceBundleData store the data as text instead of a properties map.- Parameters:
id- The id of the resource bundle data- Returns:
- A ResourceBundleData instance or no record is found.
-
removeResourceBundleData
This method remove the data record in the databas and return the data instance after it has been removed- Parameters:
id- The id of the data record- Returns:
- A ResourceBundleData instance
-
saveResourceBundle
This method shoudl create or update a ResourceBundleData instance- Parameters:
data- the ResourceBundleData instance to update or create
-
findResourceDescriptions
This method search and return a page description iterator- Parameters:
q- The search criteria- Returns:
- A PageDescription Iterator
-
createResourceBundleDataInstance
ResourceBundleData createResourceBundleDataInstance()This method is acted as a factory of- Returns:
-
getResourceBundleContent
Return resource bundle content- Parameters:
resourceBundleName- Resource bundle FQNlocale-Locale- Returns:
- Json Content in string representation
-