ITrackerResourcesProvider
, ConfigurationService
public class ConfigurationServiceImpl extends Object implements ConfigurationService
ConfigurationService
PNAME_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
Configuration s 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
Language s 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()
ConfigurationService
getJndiPropertiesOverridePrefix
in interface ConfigurationService
public void setJndiPropertiesOverridePrefix(String jndiPropertiesOverridePrefix)
setJndiPropertiesOverridePrefix
in interface ConfigurationService
public String getMailSessionLookupName()
ConfigurationService
getMailSessionLookupName
in interface ConfigurationService
public void setMailSessionLookupName(String mailSessionLookupName)
setMailSessionLookupName
in interface ConfigurationService
public String getProperty(String name)
ConfigurationService
getProperty
in interface ConfigurationService
name
- configuration keypublic String getProperty(String name, String defaultValue)
ConfigurationService
getProperty
in interface ConfigurationService
getProperty
in interface ITrackerResourcesProvider
name
- configuration keydefaultValue
- returned if the value is nullpublic boolean getBooleanProperty(String name, boolean defaultValue)
ConfigurationService
getBooleanProperty
in interface ConfigurationService
name
- configuration keydefaultValue
- returned if the value is nullpublic int getIntegerProperty(String name, int defaultValue)
ConfigurationService
getIntegerProperty
in interface ConfigurationService
name
- configuration keydefaultValue
- returned if the value is nullpublic long getLongProperty(String name, long defaultValue)
ConfigurationService
getLongProperty
in interface ConfigurationService
name
- configuration keydefaultValue
- returned if the value is nullpublic Configuration getConfigurationItem(Integer id)
ConfigurationService
getConfigurationItem
in interface ConfigurationService
id
- the row identifier@Deprecated public List<Configuration> getConfigurationItemsByType(int type)
ConfigurationService
getConfigurationItemsByType
in interface ConfigurationService
type
- the type of configuration items to retrievepublic List<Configuration> getConfigurationItemsByType(Configuration.Type type)
ConfigurationService
getConfigurationItemsByType
in interface ConfigurationService
type
- the type of configuration items to retrieve@Deprecated public List<Configuration> getConfigurationItemsByType(int type, Locale locale)
ConfigurationService
getConfigurationItemsByType
in interface ConfigurationService
type
- 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)
ConfigurationService
getConfigurationItemsByType
in interface ConfigurationService
type
- the type of configuration items to retrievelocale
- the locale to use when setting the configuration items name valuespublic Configuration createConfigurationItem(Configuration configuration)
ConfigurationService
Configuration
.createConfigurationItem
in interface ConfigurationService
configuration
- The Configuration
to storeConfiguration
after savingpublic Configuration updateConfigurationItem(Configuration configuration)
ConfigurationService
Version will be fixed to current initialized version.
updateConfigurationItem
in interface ConfigurationService
configuration
- a Configuration of the item to update@Deprecated public List<Configuration> updateConfigurationItems(List<Configuration> configurations, Configuration.Type type)
ConfigurationService
Version will be fixed to current initialized version.
updateConfigurationItems
in interface ConfigurationService
configurations
- the ConfigurationModels
to updatetype
- The type of the ConfigurationItem
s to updatepublic void removeConfigurationItem(Integer id)
Configuration
by primary key id
and deletes it.
removeConfigurationItem
in interface ConfigurationService
id
- The id of the COnfigurationBean
to removepublic void removeConfigurationItems(int type)
Configuration
s of the give type
removeConfigurationItems
in interface ConfigurationService
type
- the type of Configuration
to removepublic void removeConfigurationItems(Configuration.Type type)
Configuration
s of the give type
removeConfigurationItems
in interface ConfigurationService
type
- the type of Configuration
to removepublic void removeConfigurationItems(Configuration configuration)
ConfigurationService
removeConfigurationItems
in interface ConfigurationService
configuration
- the model to determine the type and value frompublic boolean configurationItemExists(Configuration configuration)
configurationItemExists
in interface ConfigurationService
public String getInitializedVersionString()
public boolean isConfigurationItemUpToDate(Configuration configuration)
isConfigurationItemUpToDate
in interface ConfigurationService
public void resetConfigurationCache()
ConfigurationService
resetConfigurationCache
in interface ConfigurationService
public void resetConfigurationCache(Configuration.Type type)
ConfigurationService
resetConfigurationCache
in interface ConfigurationService
type
- the type of configuration item to reset in any caches@Deprecated public void resetConfigurationCache(int type)
ConfigurationService
resetConfigurationCache
in interface ConfigurationService
type
- the type of configuration item to reset in any cachespublic ProjectScript getProjectScript(Integer scriptId)
ConfigurationService
getProjectScript
in interface ConfigurationService
scriptId
- the id of the requested scriptpublic List<ProjectScript> getProjectScripts()
ConfigurationService
getProjectScripts
in interface ConfigurationService
public ProjectScript createProjectScript(ProjectScript projectScript)
ConfigurationService
createProjectScript
in interface ConfigurationService
projectScript
- the model to create the script frompublic ProjectScript updateProjectScript(ProjectScript projectScript)
ConfigurationService
updateProjectScript
in interface ConfigurationService
projectScript
- a ProjectScript of the item to updatepublic void removeProjectScript(Integer projectScript_id)
removeProjectScript
in interface ConfigurationService
projectScript_id
- the id of the project script to removepublic WorkflowScript getWorkflowScript(Integer id)
ConfigurationService
getWorkflowScript
in interface ConfigurationService
id
- the id of the requested scriptpublic List<WorkflowScript> getWorkflowScripts()
ConfigurationService
getWorkflowScripts
in interface ConfigurationService
public WorkflowScript createWorkflowScript(WorkflowScript workflowScript)
createWorkflowScript
in interface ConfigurationService
workflowScript
- The WorkflowScript
carring the dataWorkflowScript
after insertingpublic WorkflowScript updateWorkflowScript(WorkflowScript workflowScript)
ConfigurationService
updateWorkflowScript
in interface ConfigurationService
workflowScript
- a WorkflowScript of the item to updatepublic void removeWorkflowScript(Integer workflowScript_id)
removeWorkflowScript
in interface ConfigurationService
workflowScript_id
- the id of the workflow script to removepublic CustomField getCustomField(Integer id)
ConfigurationService
getCustomField
in interface ConfigurationService
id
- the id of the requested field@Deprecated public List<CustomField> getCustomFields()
ConfigurationService
getCustomFields
in interface ConfigurationService
public List<CustomField> getCustomFieldsSorted(Locale locale)
public CustomField createCustomField(CustomField customField)
createCustomField
in interface ConfigurationService
customField
- The CustomField
carrying the dataCustomField
after savingpublic CustomField updateCustomField(CustomField customField)
ConfigurationService
updateCustomField
in interface ConfigurationService
customField
- a CustomField of the item to updatepublic boolean removeCustomField(Integer customFieldId)
removeCustomField
in interface ConfigurationService
customFieldId
- the primary keypublic CustomFieldValue getCustomFieldValue(Integer id)
CustomFieldValue
by primary keygetCustomFieldValue
in interface ConfigurationService
id
- the primary keyCustomFieldValue
found or null
public CustomFieldValue createCustomFieldValue(CustomFieldValue customFieldValue)
ConfigurationService
createCustomFieldValue
in interface ConfigurationService
customFieldValue
- the model to create the field frompublic CustomFieldValue updateCustomFieldValue(CustomFieldValue customFieldValue)
CustomFieldValue
.updateCustomFieldValue
in interface ConfigurationService
customFieldValue
- The model to updateCustomFieldValue
after savingpublic List<CustomFieldValue> updateCustomFieldValues(Integer customFieldId, List<CustomFieldValue> customFieldValues)
ConfigurationService
updateCustomFieldValues
in interface ConfigurationService
customFieldId
- the id of the custom field to updatecustomFieldValues
- an array of CustomFieldValueModels to updatepublic boolean removeCustomFieldValue(Integer customFieldValueId)
removeCustomFieldValue
in interface ConfigurationService
customFieldValueId
- the id of the custoem fieldpublic boolean removeCustomFieldValues(Integer customFieldId)
removeCustomFieldValues
in interface ConfigurationService
customFieldId
- The id of the customFieldpublic String getLanguageValue(String key, Locale locale)
getLanguageValue
in interface ConfigurationService
public String getLanguageEntry(String key, Locale locale)
ITrackerResourcesProvider
getLanguageEntry
in interface ITrackerResourcesProvider
key
- the keylocale
- the localepublic Language getLanguageItemByKey(String key, Locale locale)
ConfigurationService
getLanguageItemByKey
in interface ConfigurationService
key
- the key to look uplocale
- the localue to translate the key forpublic List<Language> getLanguageItemsByKey(String key)
ConfigurationService
getLanguageItemsByKey
in interface ConfigurationService
key
- the key to look uppublic Language updateLanguageItem(Language language)
ConfigurationService
updateLanguageItem
in interface ConfigurationService
language
- A Language for the key to updatepublic boolean removeLanguageKey(String key)
Language
s with the give keyremoveLanguageKey
in interface ConfigurationService
key
- The key to be removedpublic void removeLanguageItem(Language language)
Language
passed as parameterremoveLanguageItem
in interface ConfigurationService
language
- The Language
to removepublic String[] getSortedKeys()
ConfigurationService
getSortedKeys
in interface ConfigurationService
public HashMap<String,String> getDefinedKeys(String locale)
getDefinedKeys
in interface ConfigurationService
public List<NameValuePair> getDefinedKeysAsArray(String locale)
getDefinedKeysAsArray
in interface ConfigurationService
public int getNumberDefinedKeys(String locale)
getNumberDefinedKeys
in interface ConfigurationService
public Properties getLanguageProperties(Locale locale)
ITrackerResourcesProvider
getLanguageProperties
in interface ConfigurationService
getLanguageProperties
in interface ITrackerResourcesProvider
locale
- the localepublic Map<String,List<String>> getAvailableLanguages()
getAvailableLanguages
in interface ConfigurationService
public int getNumberAvailableLanguages()
getNumberAvailableLanguages
in interface ConfigurationService
public void updateLanguage(Locale locale, List<Language> items)
updateLanguage
in interface ConfigurationService
public void updateLanguage(Locale locale, List<Language> items, Configuration configItem)
updateLanguage
in interface ConfigurationService
public SystemConfiguration getSystemConfiguration(Locale locale)
ConfigurationService
getSystemConfiguration
in interface ConfigurationService
public boolean initializeLocale(String locale, boolean forceReload)
ConfigurationService
initializeLocale
in interface ConfigurationService
locale
- 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()
ConfigurationService
initializeConfiguration
in interface ConfigurationService
public LanguageDAO getLanguageDAO()
public ConfigurationDAO getConfigurationDAO()
public CustomFieldDAO getCustomFieldDAO()
public CustomFieldValueDAO getCustomFieldValueDAO()
public WorkflowScriptDAO getWorkflowScriptDAO()
public String getSystemBaseURL()
getSystemBaseURL
in interface ConfigurationService
public void initializeAllLanguages(boolean forceReload)
initializeAllLanguages
in interface ConfigurationService
forceReload
- if true, it will reload the languages from the property files
even if they are listed as being up to dateCopyright © 2002–2019 itracker. All rights reserved.