org.itracker.services
Interface ConfigurationService

All Known Implementing Classes:
ConfigurationServiceImpl

public interface ConfigurationService

Manages the applications configuration properties.


Field Summary
static String PNAME_SYSTEM_BASE_URL
           
 
Method Summary
 boolean configurationItemExists(Configuration configuration)
           
 boolean configurationItemUpToDate(Configuration configuration)
           
 Configuration createConfigurationItem(Configuration configuration)
          This method will create a new Configuration for persistance in the database.
 CustomField createCustomField(CustomField customField)
          This method will create a new CustomField for persistance in the database.
 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)
          This method will create a new workflow script for persistance in the database.
 Map<String,List<String>> getAvailableLanguages()
           
 boolean getBooleanProperty(String name, boolean defaultValue)
           
 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.
 List<CustomField> getCustomFields()
          This method will return all the custom fields defined in the system.
 List<CustomField> getCustomFields(Locale locale)
          Deprecated. use CustomFieldUtilities to retrieve localization to custom fields
 CustomFieldValue getCustomFieldValue(Integer id)
          This method will return the requested custom field value.
 Map<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
 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 id)
          This method will return the requested project script.
 List<ProjectScript> getProjectScripts()
          This method will return all defined project scripts.
 Properties getProperties()
           
 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.
 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)
          This method will remove the configuration item with the supplied id.
 void removeConfigurationItems(Configuration configuration)
          This method will remove all configuration items that match the supplied models type and value.
 void removeConfigurationItems(int type)
          This method will remove all configuration items that match the supplied type.
 boolean removeCustomField(Integer customFieldId)
          Removes a single custom field from the database.
 boolean removeCustomFieldValue(Integer customFieldValueId)
          Removes a single custom field value from the database.
 boolean removeCustomFieldValues(Integer customFieldId)
          Removes all custom field values from the database for a single custom field.
 void removeLanguageItem(Language language)
           
 boolean removeLanguageKey(String key)
          This method will remove all language items with the supplied key regardless of locale.
 void removeProjectScript(Integer id)
          This method removes a project script in the database.
 void removeWorkflowScript(Integer id)
          This method removes a workflow script in the database.
 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)
          This method updates a configuration item in the database.
 List<Configuration> updateConfigurationItems(List<Configuration> configurations, int type)
           
 CustomField updateCustomField(CustomField customField)
          This method updates a custom field in the database.
 CustomFieldValue updateCustomFieldValue(CustomFieldValue customFieldValue)
          This method updates a custom field value in the database.
 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> languages)
           
 void updateLanguage(Locale locale, List<Language> languages, Configuration config)
           
 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.
 

Field Detail

PNAME_SYSTEM_BASE_URL

static final String PNAME_SYSTEM_BASE_URL
See Also:
Constant Field Values
Method Detail

getProperties

Properties getProperties()

getProperty

String getProperty(String name)

getProperty

String getProperty(String name,
                   String defaultValue)

getBooleanProperty

boolean getBooleanProperty(String name,
                           boolean defaultValue)

getIntegerProperty

int getIntegerProperty(String name,
                       int defaultValue)

getLongProperty

long getLongProperty(String name,
                     long defaultValue)

getConfigurationItem

Configuration getConfigurationItem(Integer id)

getConfigurationItemsByType

List<Configuration> getConfigurationItemsByType(int type)
Returns all the configuration items of a particular type. The name values for all the items will not be initialized.

Parameters:
type - the type of configuration items to retrieve
Returns:
an array of ConfigurationModels

getConfigurationItemsByType

List<Configuration> getConfigurationItemsByType(int type,
                                                Locale locale)
Returns all the configuration items of a particular type. In addition, all of the configuration items name values will be initialized to the values for the supplied locale.

Parameters:
type - the type of configuration items to retrieve
locale - the locale to use when setting the configuration items name values
Returns:
an array of ConfigurationModels

createConfigurationItem

Configuration createConfigurationItem(Configuration configuration)
This method will create a new Configuration for persistance in the database.

Parameters:
model - the model to create the bean from

updateConfigurationItem

Configuration updateConfigurationItem(Configuration configuration)
This method updates a configuration item in the database. It does not include any updates to language items that would be used to display the localized value of the item.

Parameters:
model - a Configuration of the item to update
Returns:
a Configuration with the updated item

updateConfigurationItems

List<Configuration> updateConfigurationItems(List<Configuration> configurations,
                                             int type)

configurationItemExists

boolean configurationItemExists(Configuration configuration)

configurationItemUpToDate

boolean configurationItemUpToDate(Configuration configuration)

removeConfigurationItem

void removeConfigurationItem(Integer id)
This method will remove the configuration item with the supplied id.

Parameters:
id - the id of the configuration information to remove

removeConfigurationItems

void removeConfigurationItems(int type)
This method will remove all configuration items that match the supplied type. This will remove all items of that type such as all system status values.

Parameters:
type - the type of configuration information to remove

removeConfigurationItems

void removeConfigurationItems(Configuration configuration)
This method will remove all configuration items that match the supplied models type and value. This effectively eliminates all previous versions of the item. It is normally called prior to a create to remove any older copies of this item.

Parameters:
model - the model to determine the type and value from

resetConfigurationCache

void resetConfigurationCache()
This method will reset any caches in the system of configuration items for all configuration item types.


resetConfigurationCache

void resetConfigurationCache(int type)
This method will reset any caches in the system of configuration items for the specified configuration item type.

Parameters:
type - the type of configuration item to reset in any caches

getProjectScript

ProjectScript getProjectScript(Integer id)
This method will return the requested project script.

Parameters:
id - the id of the requested script
Returns:
a ProjectScript with the requested script, or null if not found

getProjectScripts

List<ProjectScript> getProjectScripts()
This method will return all defined project scripts.

Returns:
a ProjectScript array with all defined scripts

createProjectScript

ProjectScript createProjectScript(ProjectScript projectScript)
This method will create a new project script for persistance in the database.

Parameters:
model - the model to create the script from

updateProjectScript

ProjectScript updateProjectScript(ProjectScript projectScript)
This method updates a project script in the database.

Parameters:
model - a ProjectScript of the item to update
Returns:
a ProjectScript with the updated item

removeProjectScript

void removeProjectScript(Integer id)
This method removes a project script in the database.

Parameters:
id - The id of the project script

getWorkflowScript

WorkflowScript getWorkflowScript(Integer id)
This method will return the requested workflow script.

Parameters:
id - the id of the requested script
Returns:
a WorkflowScript with the requested script, or null if not found

getWorkflowScripts

List<WorkflowScript> getWorkflowScripts()
This method will return all defined workflow scripts.

Returns:
a WorkflowScript array with all defined scripts

createWorkflowScript

WorkflowScript createWorkflowScript(WorkflowScript workflowScript)
This method will create a new workflow script for persistance in the database.

Parameters:
model - the model to create the script from

updateWorkflowScript

WorkflowScript updateWorkflowScript(WorkflowScript workflowScript)
This method updates a workflow script in the database.

Parameters:
model - a WorkflowScript of the item to update
Returns:
a WorkflowScript with the updated item

removeWorkflowScript

void removeWorkflowScript(Integer id)
This method removes a workflow script in the database.

Parameters:
id - The id of the workflow script

getCustomField

CustomField getCustomField(Integer id)
This method will return the requested custom field.

Parameters:
id - the id of the requested field
Returns:
a CustomField with the requested field, or null if not found

getCustomFields

List<CustomField> getCustomFields()
This method will return all the custom fields defined in the system.

Returns:
an array of CustomFieldModels

getCustomFields

List<CustomField> getCustomFields(Locale locale)
Deprecated. use CustomFieldUtilities to retrieve localization to custom fields

This method will return all the custom fields defined in the system. It will also initialize all of the field labels using the supplied locale.

Parameters:
locale - the locale to use to initialize the labels
Returns:
an array of CustomFieldModels

createCustomField

CustomField createCustomField(CustomField customField)
This method will create a new CustomField for persistance in the database. If the field includes a set of option values, those will be created also.

Parameters:
model - the model to create the field from

updateCustomField

CustomField updateCustomField(CustomField customField)
This method updates a custom field in the database. It does not include any updates to language items that would be used to display the localized label for the field. If any options are included, the list will be used to replace any existing options.

Parameters:
model - a CustomField of the item to update
Returns:
a CustomField with the updated item

removeCustomField

boolean removeCustomField(Integer customFieldId)
Removes a single custom field from the database.

Parameters:
customFieldValueId - the id of the custom field to remove

getCustomFieldValue

CustomFieldValue getCustomFieldValue(Integer id)
This method will return the requested custom field value.

Parameters:
id - the id of the requested field value
Returns:
a CustomField with the requested field value, or null if not found

createCustomFieldValue

CustomFieldValue createCustomFieldValue(CustomFieldValue customFieldValue)
This method will create a new CustomFieldValue for persistance in the database.

Parameters:
model - the model to create the field from

updateCustomFieldValue

CustomFieldValue updateCustomFieldValue(CustomFieldValue customFieldValue)
This method updates a custom field value in the database. It does not include any updates to language items that would be used to display the localized label for the field value.

Parameters:
model - a CustomFieldValue of the item to update
Returns:
a CustomFieldValue with the updated item

updateCustomFieldValues

List<CustomFieldValue> updateCustomFieldValues(Integer customFieldId,
                                               List<CustomFieldValue> customFieldValues)
This method updates a set of custom field values in the database. If the array of values is null or zero length, it will remove all existing values from the custom field. Otherwise it will update the value and sort order of all the values. If the array of models contains more or less values than the current custom field, it will not remove theose values, or create new values.

Parameters:
customFieldId - the id of the custom field to update
models - an array of CustomFieldValueModels to update
Returns:
a array of CustomFieldValueModels with the updated items

removeCustomFieldValue

boolean removeCustomFieldValue(Integer customFieldValueId)
Removes a single custom field value from the database.

Parameters:
customFieldValueId - the id of the custom field value to remove

removeCustomFieldValues

boolean removeCustomFieldValues(Integer customFieldId)
Removes all custom field values from the database for a single custom field.

Parameters:
customFieldId - the id of the custom field to remove the values for

getLanguageItemByKey

Language getLanguageItemByKey(String key,
                              Locale locale)
This method will return the translation for a particular key in a locale.

Parameters:
key - the key to look up
locale - the localue to translate the key for
Returns:
a Language with the translation

getLanguageItemsByKey

List<Language> getLanguageItemsByKey(String key)
This method will return all the translations for a particular key.

Parameters:
key - the key to look up
Returns:
an array of LanguageModels with the translations for the key

updateLanguageItem

Language updateLanguageItem(Language language)
Updates a translations for a particular key and locale.

Parameters:
model - A Language for the key to update
Returns:
a Language with the updated translation

removeLanguageKey

boolean removeLanguageKey(String key)
This method will remove all language items with the supplied key regardless of locale.

Parameters:
key - the key to remove

removeLanguageItem

void removeLanguageItem(Language language)

getSystemConfiguration

SystemConfiguration getSystemConfiguration(Locale locale)
This method will return the current configuration of the system.

Returns:
a SystemConfiguration with the current configuration of the system

getSortedKeys

String[] getSortedKeys()
Returns all of the keys currently defined in the base locale sorted and grouped in a logical manner.


getDefinedKeys

Map<String,String> getDefinedKeys(String locale)

getDefinedKeysAsArray

List<NameValuePair> getDefinedKeysAsArray(String locale)

getNumberDefinedKeys

int getNumberDefinedKeys(String locale)

getAvailableLanguages

Map<String,List<String>> getAvailableLanguages()

getNumberAvailableLanguages

int getNumberAvailableLanguages()

getLanguage

List<Language> getLanguage(Locale locale)
returns languages for the locale as list of Language-objects

Parameters:
locale -
Returns:

updateLanguage

void updateLanguage(Locale locale,
                    List<Language> languages)

updateLanguage

void updateLanguage(Locale locale,
                    List<Language> languages,
                    Configuration config)

initializeLocale

boolean initializeLocale(String locale,
                         boolean forceReload)
This method will load the specified locale. It will look for the appropriate properties file, and then load all of the resources into the database.

Parameters:
locale - the locale to load
forceReload - if true, it will reload the languages from the property file even if it is listed as being up to date

initializeConfiguration

void initializeConfiguration()
This method will load the some default system configuration data into the database. The values it loads are determined from the base ITracker.properties file so the language intiialization must be performed before this method is called.


getSystemBaseURL

String getSystemBaseURL()


Copyright © 2002-2012 itracker. All Rights Reserved.