|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.itracker.services.implementations.ConfigurationServiceImpl
public class ConfigurationServiceImpl
Implementation of the ConfigurationService Interface.
ConfigurationService| Field Summary |
|---|
| Fields inherited from interface org.itracker.services.ConfigurationService |
|---|
PNAME_SYSTEM_BASE_URL |
| Constructor Summary | |
|---|---|
ConfigurationServiceImpl(Properties configurationProperties,
ConfigurationDAO configurationDAO,
CustomFieldDAO customFieldDAO,
CustomFieldValueDAO customFieldValueDAO,
LanguageDAO languageDAO,
ProjectScriptDAO projectScriptDAO,
WorkflowScriptDAO workflowScriptDAO)
Creates a new instance using the given configuration. |
|
| Method Summary | |
|---|---|
boolean |
configurationItemExists(Configuration configuration)
|
boolean |
configurationItemUpToDate(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. |
HashMap<String,List<String>> |
getAvailableLanguages()
|
boolean |
getBooleanProperty(String name,
boolean defaultValue)
|
ConfigurationDAO |
getConfigurationDAO()
|
Configuration |
getConfigurationItem(Integer id)
|
List<Configuration> |
getConfigurationItemsByType(int type)
Returns all the configuration items of a particular type. |
List<Configuration> |
getConfigurationItemsByType(int 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()
This method will return all the custom fields defined in the system. |
List<CustomField> |
getCustomFields(Locale locale)
This method will return all the custom fields defined in the system. |
CustomFieldValue |
getCustomFieldValue(Integer id)
Gets a CustomFieldValue by primary key |
CustomFieldValueDAO |
getCustomFieldValueDAO()
|
HashMap<String,String> |
getDefinedKeys(String locale)
|
List<NameValuePair> |
getDefinedKeysAsArray(String locale)
|
int |
getIntegerProperty(String name,
int defaultValue)
|
List<Language> |
getLanguage(Locale locale)
returns languages for the locale as list of Language-objects |
LanguageDAO |
getLanguageDAO()
|
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. |
long |
getLongProperty(String name,
long defaultValue)
|
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. |
Properties |
getProperties()
returns a proxy to the properties, supplying jndi awareness |
String |
getProperty(String name)
|
String |
getProperty(String name,
String defaultValue)
|
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 |
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. |
void |
removeConfigurationItem(Integer id)
Finds the Configuration by primary key id |
void |
removeConfigurationItems(Configuration configuration)
This method will remove all configuration items that match the supplied models type and value. |
void |
removeConfigurationItems(int 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)
This method will reset any caches in the system of configuration items for the specified configuration item type. |
Configuration |
updateConfigurationItem(Configuration configuration)
Updates a ConfigurationItem |
List<Configuration> |
updateConfigurationItems(List<Configuration> configurations,
int type)
Updates the configuration items |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigurationServiceImpl(Properties configurationProperties,
ConfigurationDAO configurationDAO,
CustomFieldDAO customFieldDAO,
CustomFieldValueDAO customFieldValueDAO,
LanguageDAO languageDAO,
ProjectScriptDAO projectScriptDAO,
WorkflowScriptDAO workflowScriptDAO)
configurationProperties - itracker configuration properties
(see /WEB-INF/configuration.properties)| Method Detail |
|---|
public String getProperty(String name)
getProperty in interface ConfigurationService
public String getProperty(String name,
String defaultValue)
getProperty in interface ConfigurationService
public boolean getBooleanProperty(String name,
boolean defaultValue)
getBooleanProperty in interface ConfigurationService
public int getIntegerProperty(String name,
int defaultValue)
getIntegerProperty in interface ConfigurationService
public long getLongProperty(String name,
long defaultValue)
getLongProperty in interface ConfigurationServicepublic Properties getProperties()
getProperties in interface ConfigurationServicepublic Configuration getConfigurationItem(Integer id)
getConfigurationItem in interface ConfigurationServicepublic List<Configuration> getConfigurationItemsByType(int type)
ConfigurationService
getConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrieve
public List<Configuration> getConfigurationItemsByType(int type,
Locale locale)
ConfigurationService
getConfigurationItemsByType in interface ConfigurationServicetype - the type of configuration items to retrievelocale - the locale to use when setting the configuration items name values
public Configuration createConfigurationItem(Configuration configuration)
Configuration.
createConfigurationItem in interface ConfigurationServicemodel - The Configuration to store
Configuration after savingpublic Configuration updateConfigurationItem(Configuration configuration)
ConfigurationItem
updateConfigurationItem in interface ConfigurationServicemodel - The model containing the data
Configuration after save
public List<Configuration> updateConfigurationItems(List<Configuration> configurations,
int type)
updateConfigurationItems in interface ConfigurationServicemodels - the ConfigurationModels to updatetype - The type of the ConfigurationItems to update
public void removeConfigurationItem(Integer id)
Configuration by primary key id
and deletes it.
- Specified by:
removeConfigurationItem in interface ConfigurationService
- Parameters:
id - The id of the COnfigurationBean to remove
public void removeConfigurationItems(int type)
Configurations of the give type
removeConfigurationItems in interface ConfigurationServicetype - the type of Configuration to removepublic void removeConfigurationItems(Configuration configuration)
ConfigurationService
removeConfigurationItems in interface ConfigurationServicepublic boolean configurationItemExists(Configuration configuration)
configurationItemExists in interface ConfigurationServicepublic boolean configurationItemUpToDate(Configuration configuration)
configurationItemUpToDate in interface ConfigurationServicepublic void resetConfigurationCache()
ConfigurationService
resetConfigurationCache in interface ConfigurationServicepublic void resetConfigurationCache(int type)
ConfigurationService
resetConfigurationCache in interface ConfigurationServicetype - the type of configuration item to reset in any cachespublic ProjectScript getProjectScript(Integer scriptId)
ConfigurationService
getProjectScript in interface ConfigurationServicescriptId - the id of the requested script
public List<ProjectScript> getProjectScripts()
ConfigurationService
getProjectScripts in interface ConfigurationServicepublic ProjectScript createProjectScript(ProjectScript projectScript)
ConfigurationService
createProjectScript in interface ConfigurationServicepublic ProjectScript updateProjectScript(ProjectScript projectScript)
ConfigurationService
updateProjectScript in interface ConfigurationServicepublic void removeProjectScript(Integer projectScript_id)
removeProjectScript in interface ConfigurationServiceid - the id of the project script to removepublic WorkflowScript getWorkflowScript(Integer id)
ConfigurationService
getWorkflowScript in interface ConfigurationServiceid - the id of the requested script
public List<WorkflowScript> getWorkflowScripts()
ConfigurationService
getWorkflowScripts in interface ConfigurationServicepublic WorkflowScript createWorkflowScript(WorkflowScript workflowScript)
createWorkflowScript in interface ConfigurationServicemodel - The WorkflowScript carring the data
WorkflowScript after insertingpublic WorkflowScript updateWorkflowScript(WorkflowScript workflowScript)
ConfigurationService
updateWorkflowScript in interface ConfigurationServicepublic void removeWorkflowScript(Integer workflowScript_id)
removeWorkflowScript in interface ConfigurationServiceid - the id of the workflow script to removepublic CustomField getCustomField(Integer id)
ConfigurationService
getCustomField in interface ConfigurationServiceid - the id of the requested field
public List<CustomField> getCustomFields()
ConfigurationService
getCustomFields in interface ConfigurationServicepublic List<CustomField> getCustomFields(Locale locale)
ConfigurationService
getCustomFields in interface ConfigurationServicelocale - the locale to use to initialize the labels
public CustomField createCustomField(CustomField customField)
createCustomField in interface ConfigurationServicecustomField - The CustomField carrying the data
CustomField after savingpublic CustomField updateCustomField(CustomField customField)
ConfigurationService
updateCustomField in interface ConfigurationServicepublic boolean removeCustomField(Integer customFieldId)
removeCustomField in interface ConfigurationServicecustomFieldId - the primary keypublic CustomFieldValue getCustomFieldValue(Integer id)
CustomFieldValue by primary key
getCustomFieldValue in interface ConfigurationServiceid - the primary key
CustomFieldValue found or nullpublic CustomFieldValue createCustomFieldValue(CustomFieldValue customFieldValue)
ConfigurationService
createCustomFieldValue in interface ConfigurationServicepublic CustomFieldValue updateCustomFieldValue(CustomFieldValue customFieldValue)
CustomFieldValue.
updateCustomFieldValue in interface ConfigurationServicemodel - The model to update
CustomFieldValue after saving
public List<CustomFieldValue> updateCustomFieldValues(Integer customFieldId,
List<CustomFieldValue> customFieldValues)
ConfigurationService
updateCustomFieldValues in interface ConfigurationServicecustomFieldId - the id of the custom field to update
public 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 customField
public Language getLanguageItemByKey(String key,
Locale locale)
ConfigurationService
getLanguageItemByKey in interface ConfigurationServicekey - the key to look uplocale - the localue to translate the key for
public List<Language> getLanguageItemsByKey(String key)
ConfigurationService
getLanguageItemsByKey in interface ConfigurationServicekey - the key to look up
public Language updateLanguageItem(Language language)
ConfigurationService
updateLanguageItem in interface ConfigurationServicepublic boolean removeLanguageKey(String key)
Languages with the give key
removeLanguageKey in interface ConfigurationServicekey - The key to be removedpublic void removeLanguageItem(Language language)
Language passed as parameter
removeLanguageItem in interface ConfigurationServicemodel - The Language to removepublic String[] getSortedKeys()
ConfigurationService
getSortedKeys 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 List<Language> getLanguage(Locale locale)
ConfigurationService
getLanguage in interface ConfigurationServicepublic HashMap<String,List<String>> getAvailableLanguages()
getAvailableLanguages in interface ConfigurationServicepublic 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 ConfigurationServicepublic SystemConfiguration getSystemConfiguration(Locale locale)
ConfigurationService
getSystemConfiguration in interface ConfigurationService
public boolean initializeLocale(String locale,
boolean forceReload)
ConfigurationService
initializeLocale 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()
ConfigurationService
initializeConfiguration in interface ConfigurationServicepublic LanguageDAO getLanguageDAO()
public ConfigurationDAO getConfigurationDAO()
public CustomFieldDAO getCustomFieldDAO()
public CustomFieldValueDAO getCustomFieldValueDAO()
public WorkflowScriptDAO getWorkflowScriptDAO()
public String getSystemBaseURL()
getSystemBaseURL in interface ConfigurationService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||