Class MultiSilverpeasBundle


  • public class MultiSilverpeasBundle
    extends Object
    A bundle that is a wrapper of several kinds of resource bundles.
    • Constructor Detail

      • MultiSilverpeasBundle

        public MultiSilverpeasBundle​(LocalizationBundle specificMultilang,
                                     SettingBundle specificIcons,
                                     String language)
        Constructs a new multiple bundle.
        Parameters:
        specificMultilang - the localized messages
        specificIcons - the icons
        language - the language of the localized resources.
      • MultiSilverpeasBundle

        public MultiSilverpeasBundle​(LocalizationBundle specificMultilang,
                                     SettingBundle specificIcons,
                                     SettingBundle specificSettings,
                                     String language)
        Constructs a new multiple bundle.
        Parameters:
        specificMultilang - the localized messages
        specificIcons - the icons
        specificSettings - the settings
        language - the language of the localized resources.
      • MultiSilverpeasBundle

        public MultiSilverpeasBundle​(LocalizationBundle specificMultilang,
                                     String language)
        Constructs a new multiple bundle.
        Parameters:
        specificMultilang - the localized messages
        language - the language of the localized resources.
    • Method Detail

      • getMultilangBundle

        public ResourceBundle getMultilangBundle()
        Return the ResourceBundle for usage in JSTL.
        Returns:
        the ResourceBundle.
      • getIconsBundle

        public SettingBundle getIconsBundle()
        Return the icons settings.
        Returns:
        the SettingBundle.
      • getString

        public String getString​(String key)
        Parameters:
        key - - key in the multilang file
        Returns:
        the value of the key according to the key. If key starts with "GML.", we look at in the general multilang. Else, we look at in the component multilang
      • getStringWithParams

        public String getStringWithParams​(String key,
                                          String[] params)
      • getLanguage

        public String getLanguage()
      • getSetting

        public String getSetting​(String key)
        We look at the key in the specific settings file.
        Parameters:
        key - - key in the settings file
        Returns:
        the value of the key if the key exists and if a value is specified. null otherwise.
      • getSetting

        public boolean getSetting​(String key,
                                  boolean defaultValue)
      • getSetting

        public int getSetting​(String key,
                              int defaultValue)
      • getOutputDate

        public String getOutputDate​(Date date)
      • getOutputDateAndHour

        public String getOutputDateAndHour​(Date date)
      • getOutputDateAndHour

        public String getOutputDateAndHour​(Date date,
                                           Date defaultDate)
        Display first not null date
        Parameters:
        date - date to display
        defaultDate - extra date to display if date1 is empty (or null)
        Returns:
        the formatted date
      • getInputDate

        public String getInputDate​(Date date)
      • getDBDate

        public String getDBDate​(Date date)