ITrackerResourcesProvider, ConfigurationServicepublic class ConfigurationServiceImpl extends Object implements ConfigurationService
ConfigurationServicePNAME_SYSTEM_BASE_URL| Constructor | Description |
|---|---|
ConfigurationServiceImpl(Properties configurationProperties,
ConfigurationDAO configurationDAO,
CustomFieldDAO customFieldDAO,
CustomFieldValueDAO customFieldValueDAO,
LanguageDAO languageDAO,
ProjectScriptDAO projectScriptDAO,
WorkflowScriptDAO workflowScriptDAO) |
Creates a new instance using the given configuration.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
configurationItemExists(Configuration configuration) |
|
Configuration |
createConfigurationItem(Configuration configuration) |
Creates a
Configuration. |
CustomField |
createCustomField(CustomField customField) |
Creates a custom field
|
CustomFieldValue |
createCustomFieldValue(CustomFieldValue customFieldValue) |
This method will create a new CustomFieldValue for persistance in the database.
|
ProjectScript |
createProjectScript(ProjectScript projectScript) |
This method will create a new project script for persistance in the database.
|
WorkflowScript |
createWorkflowScript(WorkflowScript workflowScript) |
Creates a workflow script.
|
Map<String,List<String>> |
getAvailableLanguages() |
|
boolean |
getBooleanProperty(String name,
boolean defaultValue) |
Load a configuration from application properties.
|
ConfigurationDAO |
getConfigurationDAO() |
|
Configuration |
getConfigurationItem(Integer id) |
Load a configuration from database.
|
List<Configuration> |
getConfigurationItemsByType(int type) |
Deprecated.
|
List<Configuration> |
getConfigurationItemsByType(int type,
Locale locale) |
Deprecated.
|
List<Configuration> |
getConfigurationItemsByType(Configuration.Type type) |
Returns all the configuration items of a particular type.
|
List<Configuration> |
getConfigurationItemsByType(Configuration.Type type,
Locale locale) |
Returns all the configuration items of a particular type.
|
CustomField |
getCustomField(Integer id) |
This method will return the requested custom field.
|
CustomFieldDAO |
getCustomFieldDAO() |
|
List<CustomField> |
getCustomFields() |
Deprecated.
|
List<CustomField> |
getCustomFieldsSorted(Locale locale) |
|
CustomFieldValue |
getCustomFieldValue(Integer id) |
Gets a
CustomFieldValue by primary key |
CustomFieldValueDAO |
getCustomFieldValueDAO() |
|
HashMap<String,String> |
getDefinedKeys(String locale) |
|
List<NameValuePair> |
getDefinedKeysAsArray(String locale) |
|
String |
getInitializedVersionString() |
|
int |
getIntegerProperty(String name,
int defaultValue) |
Load a configuration from application properties.
|
String |
getJndiPropertiesOverridePrefix() |
The JNDI context where the configuration.properties values can be overridden.
|
LanguageDAO |
getLanguageDAO() |
|
String |
getLanguageEntry(String key,
Locale locale) |
Load the exact translation by key for a locale.
|
Language |
getLanguageItemByKey(String key,
Locale locale) |
This method will return the translation for a particular key in a locale.
|
List<Language> |
getLanguageItemsByKey(String key) |
This method will return all the translations for a particular key.
|
Properties |
getLanguageProperties(Locale locale) |
Load all translation keys for a locale.
|
String |
getLanguageValue(String key,
Locale locale) |
|
long |
getLongProperty(String name,
long defaultValue) |
Load a configuration from application properties.
|
String |
getMailSessionLookupName() |
The JNDI lookup name for the mail-session.
|
int |
getNumberAvailableLanguages() |
|
int |
getNumberDefinedKeys(String locale) |
|
ProjectScript |
getProjectScript(Integer scriptId) |
This method will return the requested project script.
|
List<ProjectScript> |
getProjectScripts() |
This method will return all defined project scripts.
|
String |
getProperty(String name) |
Load a configuration from application properties.
|
String |
getProperty(String name,
String defaultValue) |
Load a configuration from application properties.
|
String[] |
getSortedKeys() |
Returns all of the keys currently defined in the base locale sorted and grouped in a
logical manner.
|
String |
getSystemBaseURL() |
|
SystemConfiguration |
getSystemConfiguration(Locale locale) |
This method will return the current configuration of the system.
|
WorkflowScript |
getWorkflowScript(Integer id) |
This method will return the requested workflow script.
|
WorkflowScriptDAO |
getWorkflowScriptDAO() |
|
List<WorkflowScript> |
getWorkflowScripts() |
This method will return all defined workflow scripts.
|
void |
initializeAllLanguages(boolean forceReload) |
This method will attempt to load all of the locales defined in the
ITracker.properties file, and add them to the database if they don't
already exist.
|
void |
initializeConfiguration() |
This method will load the some default system configuration data into the database.
|
boolean |
initializeLocale(String locale,
boolean forceReload) |
This method will load the specified locale.
|
boolean |
isConfigurationItemUpToDate(Configuration configuration) |
|
void |
removeConfigurationItem(Integer id) |
Finds the
Configuration by primary key id |
void |
removeConfigurationItems(int type) |
Deprecated.
|
void |
removeConfigurationItems(Configuration configuration) |
This method will remove all configuration items that match the supplied models
type and value.
|
void |
removeConfigurationItems(Configuration.Type type) |
Removes all
Configurations of the give type |
boolean |
removeCustomField(Integer customFieldId) |
searches for a custom field by primary key and removes it
|
boolean |
removeCustomFieldValue(Integer customFieldValueId) |
removes a custom field value by primary key
|
boolean |
removeCustomFieldValues(Integer customFieldId) |
Removes all field values of a given custom field
|
void |
removeLanguageItem(Language language) |
Removes the
Language passed as parameter |
boolean |
removeLanguageKey(String key) |
Removes all
Languages with the give key |
void |
removeProjectScript(Integer projectScript_id) |
remove a project script by its id
|
void |
removeWorkflowScript(Integer workflowScript_id) |
remove a workflow script by its id
|
void |
resetConfigurationCache() |
This method will reset any caches in the system of configuration items for all configuration
item types.
|
void |
resetConfigurationCache(int type) |
Deprecated.
|
void |
resetConfigurationCache(Configuration.Type type) |
This method will reset any caches in the system of configuration items for the specified
configuration item type.
|
void |
setJndiPropertiesOverridePrefix(String jndiPropertiesOverridePrefix) |
|
void |
setMailSessionLookupName(String mailSessionLookupName) |
|
Configuration |
updateConfigurationItem(Configuration configuration) |
This method updates a configuration item in the database.
|
List<Configuration> |
updateConfigurationItems(List<Configuration> configurations,
Configuration.Type type) |
Deprecated.
|
CustomField |
updateCustomField(CustomField customField) |
This method updates a custom field in the database.
|
CustomFieldValue |
updateCustomFieldValue(CustomFieldValue customFieldValue) |
Updates a
CustomFieldValue. |
List<CustomFieldValue> |
updateCustomFieldValues(Integer customFieldId,
List<CustomFieldValue> customFieldValues) |
This method updates a set of custom field values in the database.
|
void |
updateLanguage(Locale locale,
List<Language> items) |
|
void |
updateLanguage(Locale locale,
List<Language> items,
Configuration configItem) |
|
Language |
updateLanguageItem(Language language) |
Updates a translations for a particular key and locale.
|
ProjectScript |
updateProjectScript(ProjectScript projectScript) |
This method updates a project script in the database.
|
WorkflowScript |
updateWorkflowScript(WorkflowScript workflowScript) |
This method updates a workflow script in the database.
|
public ConfigurationServiceImpl(Properties configurationProperties, ConfigurationDAO configurationDAO, CustomFieldDAO customFieldDAO, CustomFieldValueDAO customFieldValueDAO, LanguageDAO languageDAO, ProjectScriptDAO projectScriptDAO, WorkflowScriptDAO workflowScriptDAO)
configurationProperties - itracker configuration properties
(see classpath:configuration.properties)public String getJndiPropertiesOverridePrefix()
ConfigurationServicegetJndiPropertiesOverridePrefix in interface ConfigurationServicepublic void setJndiPropertiesOverridePrefix(String jndiPropertiesOverridePrefix)
setJndiPropertiesOverridePrefix in interface ConfigurationServicepublic String getMailSessionLookupName()
ConfigurationServicegetMailSessionLookupName in interface ConfigurationServicepublic void setMailSessionLookupName(String mailSessionLookupName)
setMailSessionLookupName in interface ConfigurationServicepublic String getProperty(String name)
ConfigurationServicegetProperty in interface ConfigurationServicename - configuration keypublic String getProperty(String name, String defaultValue)
ConfigurationServicegetProperty in interface ConfigurationServicegetProperty in interface ITrackerResourcesProvidername - configuration keydefaultValue - returned if the value is nullpublic boolean getBooleanProperty(String name, boolean defaultValue)
ConfigurationServicegetBooleanProperty in interface ConfigurationServicename - configuration keydefaultValue - returned if the value is nullpublic int getIntegerProperty(String name, int defaultValue)
ConfigurationServicegetIntegerProperty in interface ConfigurationServicename - configuration keydefaultValue - returned if the value is nullpublic long getLongProperty(String name, long defaultValue)
ConfigurationServicegetLongProperty in interface ConfigurationServicename - configuration keydefaultValue - returned if the value is nullpublic Configuration getConfigurationItem(Integer id)
ConfigurationServicegetConfigurationItem in interface ConfigurationServiceid - the row identifier@Deprecated public List<Configuration> getConfigurationItemsByType(int type)
ConfigurationServicegetConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrievepublic List<Configuration> getConfigurationItemsByType(Configuration.Type type)
ConfigurationServicegetConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrieve@Deprecated public List<Configuration> getConfigurationItemsByType(int type, Locale locale)
ConfigurationServicegetConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrievelocale - the locale to use when setting the configuration items name valuespublic List<Configuration> getConfigurationItemsByType(Configuration.Type type, Locale locale)
ConfigurationServicegetConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrievelocale - the locale to use when setting the configuration items name valuespublic Configuration createConfigurationItem(Configuration configuration)
ConfigurationServiceConfiguration.createConfigurationItem in interface ConfigurationServiceconfiguration - The Configuration to storeConfiguration after savingpublic Configuration updateConfigurationItem(Configuration configuration)
ConfigurationServiceVersion will be fixed to current initialized version.
updateConfigurationItem in interface ConfigurationServiceconfiguration - a Configuration of the item to update@Deprecated public List<Configuration> updateConfigurationItems(List<Configuration> configurations, Configuration.Type type)
ConfigurationServiceVersion will be fixed to current initialized version.
updateConfigurationItems in interface ConfigurationServiceconfigurations - the ConfigurationModels to updatetype - The type of the ConfigurationItems to updatepublic void removeConfigurationItem(Integer id)
Configuration by primary key id
and deletes it.removeConfigurationItem in interface ConfigurationServiceid - The id of the COnfigurationBean to removepublic void removeConfigurationItems(int type)
Configurations of the give typeremoveConfigurationItems in interface ConfigurationServicetype - the type of Configuration to removepublic void removeConfigurationItems(Configuration.Type type)
Configurations of the give typeremoveConfigurationItems in interface ConfigurationServicetype - the type of Configuration to removepublic void removeConfigurationItems(Configuration configuration)
ConfigurationServiceremoveConfigurationItems in interface ConfigurationServiceconfiguration - the model to determine the type and value frompublic boolean configurationItemExists(Configuration configuration)
configurationItemExists in interface ConfigurationServicepublic String getInitializedVersionString()
public boolean isConfigurationItemUpToDate(Configuration configuration)
isConfigurationItemUpToDate in interface ConfigurationServicepublic void resetConfigurationCache()
ConfigurationServiceresetConfigurationCache in interface ConfigurationServicepublic void resetConfigurationCache(Configuration.Type type)
ConfigurationServiceresetConfigurationCache in interface ConfigurationServicetype - the type of configuration item to reset in any caches@Deprecated public void resetConfigurationCache(int type)
ConfigurationServiceresetConfigurationCache in interface ConfigurationServicetype - the type of configuration item to reset in any cachespublic ProjectScript getProjectScript(Integer scriptId)
ConfigurationServicegetProjectScript in interface ConfigurationServicescriptId - the id of the requested scriptpublic List<ProjectScript> getProjectScripts()
ConfigurationServicegetProjectScripts in interface ConfigurationServicepublic ProjectScript createProjectScript(ProjectScript projectScript)
ConfigurationServicecreateProjectScript in interface ConfigurationServiceprojectScript - the model to create the script frompublic ProjectScript updateProjectScript(ProjectScript projectScript)
ConfigurationServiceupdateProjectScript in interface ConfigurationServiceprojectScript - a ProjectScript of the item to updatepublic void removeProjectScript(Integer projectScript_id)
removeProjectScript in interface ConfigurationServiceprojectScript_id - the id of the project script to removepublic WorkflowScript getWorkflowScript(Integer id)
ConfigurationServicegetWorkflowScript in interface ConfigurationServiceid - the id of the requested scriptpublic List<WorkflowScript> getWorkflowScripts()
ConfigurationServicegetWorkflowScripts in interface ConfigurationServicepublic WorkflowScript createWorkflowScript(WorkflowScript workflowScript)
createWorkflowScript in interface ConfigurationServiceworkflowScript - The WorkflowScript carring the dataWorkflowScript after insertingpublic WorkflowScript updateWorkflowScript(WorkflowScript workflowScript)
ConfigurationServiceupdateWorkflowScript in interface ConfigurationServiceworkflowScript - a WorkflowScript of the item to updatepublic void removeWorkflowScript(Integer workflowScript_id)
removeWorkflowScript in interface ConfigurationServiceworkflowScript_id - the id of the workflow script to removepublic CustomField getCustomField(Integer id)
ConfigurationServicegetCustomField in interface ConfigurationServiceid - the id of the requested field@Deprecated public List<CustomField> getCustomFields()
ConfigurationServicegetCustomFields in interface ConfigurationServicepublic List<CustomField> getCustomFieldsSorted(Locale locale)
public CustomField createCustomField(CustomField customField)
createCustomField in interface ConfigurationServicecustomField - The CustomField carrying the dataCustomField after savingpublic CustomField updateCustomField(CustomField customField)
ConfigurationServiceupdateCustomField in interface ConfigurationServicecustomField - a CustomField of the item to updatepublic boolean removeCustomField(Integer customFieldId)
removeCustomField in interface ConfigurationServicecustomFieldId - the primary keypublic CustomFieldValue getCustomFieldValue(Integer id)
CustomFieldValue by primary keygetCustomFieldValue in interface ConfigurationServiceid - the primary keyCustomFieldValue found or nullpublic CustomFieldValue createCustomFieldValue(CustomFieldValue customFieldValue)
ConfigurationServicecreateCustomFieldValue in interface ConfigurationServicecustomFieldValue - the model to create the field frompublic CustomFieldValue updateCustomFieldValue(CustomFieldValue customFieldValue)
CustomFieldValue.updateCustomFieldValue in interface ConfigurationServicecustomFieldValue - The model to updateCustomFieldValue after savingpublic List<CustomFieldValue> updateCustomFieldValues(Integer customFieldId, List<CustomFieldValue> customFieldValues)
ConfigurationServiceupdateCustomFieldValues in interface ConfigurationServicecustomFieldId - the id of the custom field to updatecustomFieldValues - an array of CustomFieldValueModels to updatepublic boolean removeCustomFieldValue(Integer customFieldValueId)
removeCustomFieldValue in interface ConfigurationServicecustomFieldValueId - the id of the custoem fieldpublic boolean removeCustomFieldValues(Integer customFieldId)
removeCustomFieldValues in interface ConfigurationServicecustomFieldId - The id of the customFieldpublic String getLanguageValue(String key, Locale locale)
getLanguageValue in interface ConfigurationServicepublic String getLanguageEntry(String key, Locale locale)
ITrackerResourcesProvidergetLanguageEntry in interface ITrackerResourcesProviderkey - the keylocale - the localepublic Language getLanguageItemByKey(String key, Locale locale)
ConfigurationServicegetLanguageItemByKey in interface ConfigurationServicekey - the key to look uplocale - the localue to translate the key forpublic List<Language> getLanguageItemsByKey(String key)
ConfigurationServicegetLanguageItemsByKey in interface ConfigurationServicekey - the key to look uppublic Language updateLanguageItem(Language language)
ConfigurationServiceupdateLanguageItem in interface ConfigurationServicelanguage - A Language for the key to updatepublic boolean removeLanguageKey(String key)
Languages with the give keyremoveLanguageKey in interface ConfigurationServicekey - The key to be removedpublic void removeLanguageItem(Language language)
Language passed as parameterremoveLanguageItem in interface ConfigurationServicelanguage - The Language to removepublic String[] getSortedKeys()
ConfigurationServicegetSortedKeys in interface ConfigurationServicepublic HashMap<String,String> getDefinedKeys(String locale)
getDefinedKeys in interface ConfigurationServicepublic List<NameValuePair> getDefinedKeysAsArray(String locale)
getDefinedKeysAsArray in interface ConfigurationServicepublic int getNumberDefinedKeys(String locale)
getNumberDefinedKeys in interface ConfigurationServicepublic Properties getLanguageProperties(Locale locale)
ITrackerResourcesProvidergetLanguageProperties in interface ConfigurationServicegetLanguageProperties in interface ITrackerResourcesProviderlocale - the localepublic Map<String,List<String>> getAvailableLanguages()
getAvailableLanguages in interface ConfigurationServicepublic int getNumberAvailableLanguages()
getNumberAvailableLanguages in interface ConfigurationServicepublic void updateLanguage(Locale locale, List<Language> items)
updateLanguage in interface ConfigurationServicepublic void updateLanguage(Locale locale, List<Language> items, Configuration configItem)
updateLanguage in interface ConfigurationServicepublic SystemConfiguration getSystemConfiguration(Locale locale)
ConfigurationServicegetSystemConfiguration in interface ConfigurationServicepublic boolean initializeLocale(String locale, boolean forceReload)
ConfigurationServiceinitializeLocale in interface ConfigurationServicelocale - the locale to loadforceReload - if true, it will reload the languages from the property file even if it is listed
as being up to datepublic void initializeConfiguration()
ConfigurationServiceinitializeConfiguration in interface ConfigurationServicepublic LanguageDAO getLanguageDAO()
public ConfigurationDAO getConfigurationDAO()
public CustomFieldDAO getCustomFieldDAO()
public CustomFieldValueDAO getCustomFieldValueDAO()
public WorkflowScriptDAO getWorkflowScriptDAO()
public String getSystemBaseURL()
getSystemBaseURL in interface ConfigurationServicepublic void initializeAllLanguages(boolean forceReload)
initializeAllLanguages in interface ConfigurationServiceforceReload - if true, it will reload the languages from the property files
even if they are listed as being up to dateCopyright © 2002–2022 itracker. All rights reserved.