public class DatabaseBundleManager extends AbstractRemoteReference implements IDatabaseBundleManager
dbConnectionManagerId, locatorref| Constructor and Description |
|---|
DatabaseBundleManager(int port,
EntityReferenceLocator locator,
Hashtable params) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
autoconfigureLocaleColumns() |
EntityResult |
executePreparedStatement(SQLStatementBuilder.SQLStatement sqlStatement,
Connection con,
int sessionId,
List queryColumns) |
protected EntityResult |
executeQueryStatement(SQLStatementBuilder.SQLStatement sqlStatement,
int sessionId,
List queryColumns,
Connection con) |
protected void |
executeUpdateStatement(SQLStatementBuilder.SQLStatement sqlStatement,
int sessionId,
Connection con) |
Hashtable |
getAllResourceBundles(Locale locale,
int sessionId)
Get a hashtable with all the available bundles in the database for the
specified locale
|
DatabaseBundleDescriptor[] |
getAvailableBundles(int sessionId)
Get a list with all the available bundle classes
|
DatabaseBundleDescriptor[] |
getAvailableBundles(int sessionId,
Connection con)
Get all the available bundles in the database.
|
String[] |
getAvailableLocales(int sessionId)
Get a list with the suffix of the available locales in the database
|
protected ResourceBundle |
getBundle(DatabaseBundleDescriptor bundleDescriptor,
Locale locale,
int sessionId) |
ResourceBundle |
getBundle(String baseName,
Locale locale,
int sessionId)
Get the resource bundle for the specified name and locale
|
protected DatabaseBundleDescriptor |
getBundleDescriptor(String bundleClassName,
int sessionId) |
protected Object |
getBundleId(String bundleClassName,
List availablebundles,
int sessionId,
Connection con) |
Hashtable |
getBundles(List baseNames,
Locale locale,
int sessionId)
Get all the resources for the specified locale and different names
|
protected Object |
getBundleValueKey(Hashtable filter,
int sessionId,
Connection con) |
protected String |
getColumnName(Locale locale) |
protected String |
getLocaleString(String locale) |
protected String |
getTableNameFromMetadata(String tableName,
Connection con) |
protected void |
init(Hashtable params)
This method gets the
Hashtable and initializes the
properties
|
protected void |
insertBundleValue(Hashtable values,
int sessionId,
Connection con) |
protected EntityResult |
insertNewBundle(String bundleClassName,
int sessionId,
Connection con) |
protected EntityResult |
queryBundleValues(Object bundleId,
String languageColumn,
int sessionId) |
void |
resultSetToEntityResult(ResultSet resultSet,
EntityResult entityResult,
List columnNames) |
protected void |
updateBundleValue(Hashtable filter,
Hashtable values,
int sessionId,
Connection con) |
void |
updateBundleValues(DatabaseBundleValues dbvalues,
int sessionId)
Update the specified values in the database bundle
|
void |
updateBundleValues(DatabaseBundleValues dbvalues,
int sessionId,
Connection con) |
connect, connect, disconnect, getDatabaseConnectionManager, getEntityReference, hasSessionclone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogpublic static final String BUNDLE_TABLE_NAME
public static final String BUNDLE_VALUES_TABLE_NAME
public static final String BUNDLE_VALUES_ENTITY_NAME
public static final String BUNDLE_ENTITY_NAME
public static final String BUNDLE_CLASS_NAME_COLUMN
public static final String BUNDLE_DESCRIPTION_COLUMN
public static final String BUNDLE_KEY_COLUMN
public static final String BUNDLE_VALUES_KEY_COLUMN
public static final String BUNDLE_VALUES_TEXT_KEY_COLUMN
public static final String DATABASE_CONNECTION_MANAGER_ID
public static final String TO_LOWER_CASE
public static final String AUTOCONFIGURE_LOCALE_COLUMNS
public static String bundleTableName
public static String bundleValuesTableName
public static String bundleEntityName
public static String bundleValuesEntityName
public static String bundleClassNameColumn
public static String bundleDescriptionColumn
public static String bundleKeyColumn
public static String bundleValuesKeyColumn
public static String bundleValuesTextKeyColumn
public static Boolean toLowerCase
protected Hashtable localeColumnNames
protected boolean autoconfigureLocaleColumns
public DatabaseBundleManager(int port,
EntityReferenceLocator locator,
Hashtable params)
throws Exception
Exceptionprotected void init(Hashtable params)
Hashtable and initializes the
properties
init in class AbstractRemoteReferenceparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| ToLowerCase | yes/no | no | Indicates if the parameter names must be the default ones but in lower or upper case. | |
| BundleTableName | BUNDLES | no | Name of the database table that stores the available bundles. You can use only one bundle in all the application or maybe a different one in a specific form or form manager | |
| BundleEntityName | no | Name of the ontimize entity to manage the table with all the available database bundles. | ||
| BundleValuesTableName | BUNDLEVALUES | no | Name of the database table that stores the bundle values. This table must contains a column for each available language. | |
| BundleValuesEntityName | no | Name of the ontimize entity to manage the database bundle values table. | ||
| BundleClassNameColumn | BUNDLECLASSNAME | no | Name of the column that stores the bundle class name. This column is in the bundles table. | |
| BundleDescriptionColumn | DESCRIPTION | no | Name of the column that stores the bundle description. This column is in the bundles table. | |
| BundleKeyColumn | IDBUNDLE | no | Name of the column that stores the bundle key. This column is the key in the bundles table. | |
| BundleValuesKeyColumn | IDBUNDLEVALUE | no | Name of the column that stores the bundle values key. This column is the key in the bundles values table. | |
| BundleValuesTextKeyColumn | TEXTKEY | no | Name of the column that stores the text key in the bundle values table. | |
| DBConnectionManagerId | no | Name of the database connection manager that contains the bundle tables. This parameter should be use only when the entities are configured and the application is using more than one connection managers | ||
| AutoconfigureLocaleColumns | yes/no | no | no | If this parameter is true then the available languages are the columns in the bundle values table. If this is false then you have to configure a new parameter for each available language |
protected void autoconfigureLocaleColumns()
protected String getTableNameFromMetadata(String tableName, Connection con) throws SQLException
SQLExceptionpublic Hashtable getAllResourceBundles(Locale locale, int sessionId) throws Exception
IDatabaseBundleManagergetAllResourceBundles in interface IDatabaseBundleManagerlocale - LocaleExceptionpublic Hashtable getBundles(List baseNames, Locale locale, int sessionId) throws Exception
IDatabaseBundleManagergetBundles in interface IDatabaseBundleManagerbaseNames - A list of String objects with the names of the resources to
querylocale - LocaleExceptionpublic ResourceBundle getBundle(String baseName, Locale locale, int sessionId) throws Exception
IDatabaseBundleManagergetBundle in interface IDatabaseBundleManagerExceptionprotected ResourceBundle getBundle(DatabaseBundleDescriptor bundleDescriptor, Locale locale, int sessionId) throws Exception
Exceptionprotected EntityResult queryBundleValues(Object bundleId, String languageColumn, int sessionId) throws Exception
Exceptionprotected DatabaseBundleDescriptor getBundleDescriptor(String bundleClassName, int sessionId) throws Exception
Exceptionpublic DatabaseBundleDescriptor[] getAvailableBundles(int sessionId, Connection con) throws Exception
bundleValuesEntityName is not null and
a entity with this name exists then use this entity to query the
available bundles.bundleValuesEntityName is null and
bundleTableName is not null then query the table directly. In
other case return nullExceptionpublic DatabaseBundleDescriptor[] getAvailableBundles(int sessionId) throws Exception
IDatabaseBundleManagergetAvailableBundles in interface IDatabaseBundleManagerExceptionpublic String[] getAvailableLocales(int sessionId) throws Exception
IDatabaseBundleManagergetAvailableLocales in interface IDatabaseBundleManagerExceptionpublic void updateBundleValues(DatabaseBundleValues dbvalues, int sessionId) throws Exception
IDatabaseBundleManagerupdateBundleValues in interface IDatabaseBundleManagerExceptionpublic void updateBundleValues(DatabaseBundleValues dbvalues, int sessionId, Connection con) throws Exception
Exceptionprotected void updateBundleValue(Hashtable filter, Hashtable values, int sessionId, Connection con) throws Exception
Exceptionprotected void insertBundleValue(Hashtable values, int sessionId, Connection con) throws Exception
Exceptionprotected Object getBundleValueKey(Hashtable filter, int sessionId, Connection con) throws Exception
Exceptionprotected Object getBundleId(String bundleClassName, List availablebundles, int sessionId, Connection con) throws Exception
Exceptionprotected EntityResult insertNewBundle(String bundleClassName, int sessionId, Connection con) throws Exception
Exceptionprotected void executeUpdateStatement(SQLStatementBuilder.SQLStatement sqlStatement, int sessionId, Connection con) throws Exception
Exceptionprotected EntityResult executeQueryStatement(SQLStatementBuilder.SQLStatement sqlStatement, int sessionId, List queryColumns, Connection con) throws Exception
Exceptionpublic EntityResult executePreparedStatement(SQLStatementBuilder.SQLStatement sqlStatement, Connection con, int sessionId, List queryColumns) throws Exception
Exceptionpublic void resultSetToEntityResult(ResultSet resultSet, EntityResult entityResult, List columnNames) throws Exception
ExceptionCopyright © 2016 Imatia Innovation S.L.. All rights reserved.