Class SystemSettingsHelper

java.lang.Object
overit.geocallapp.wfm.systemsettings.bl.systemsetting.SystemSettingsHelper
Direct Known Subclasses:
CoreSystemSettingsHelper

public class SystemSettingsHelper extends Object
Helper for the system settings.
Since:
17.0
  • Constructor Details

    • SystemSettingsHelper

      public SystemSettingsHelper()
  • Method Details

    • getPropertyFromField

      public String getPropertyFromField(String field)
      Returns the property key starting from the system settings old field name.
      Parameters:
      field - the old field name
      Returns:
      the property key
    • getPropertyValueFromField

      public Object getPropertyValueFromField(String field)
      Returns the property value starting from the system settings old field name.
      Parameters:
      field - the old field name
      Returns:
      the property value
    • loadPropertiesConfiguration

      public org.apache.commons.configuration2.Configuration loadPropertiesConfiguration()
      Loads the configuration that maps all the new properties with the old system setting database field names.
      Returns:
      the properties configuration
    • translateSystemSettings

      public Map<String,Object> translateSystemSettings(Map<String,Object> systemSettings)
      Translates the given map of system settings by replacing only the deprecated database fields name with the new corresponding property name.
      Parameters:
      systemSettings - the system settings
      Returns:
      a new map containing all the given system settings
    • loadRecord

      protected Map<String,Object> loadRecord(Class<? extends DAO> daoClass, Map<String,Object> filter, PoolKit poolKit) throws DAException, DAValidateException
      Throws:
      DAException
      DAValidateException
    • getEnumById

      public <T extends Enum<T> & overit.geocallapp.wfm.base.systemsettings.SystemSettingsEnum> T getEnumById(Class<T> enumClazz, Long id)
      Returns the needed enum by the given id.
      Type Parameters:
      T - the generic type of the needed enum that exteds SystemSettingsEnum
      Parameters:
      enumClazz - the enum clazz
      id - the enum id
      Returns:
      the T enum
    • getEnumCode

      public <T extends Enum<T> & overit.geocallapp.wfm.base.systemsettings.SystemSettingsEnum> String getEnumCode(Class<T> enumClazz, Long id)
      Returns the enum code by the given id.
      Type Parameters:
      T - the generic type of the needed enum that exteds SystemSettingsEnum
      Parameters:
      enumClazz - the enum clazz
      id - the enum id
      Returns:
      the enum code
    • getFieldValue

      public Object getFieldValue(String field)
    • getValues

      public Map<String,Object> getValues()
      Returns the map containing all the system settings loaded using a cache mechanism.
      Returns:
      system settings map
    • existCompanySystemSettings

      public boolean existCompanySystemSettings(Long companyId)
      Checks if the company has system settings.
      Returns:
      true if the company has system settings, false otherwise