Class LocaleSelectionDataGetter

  • All Implemented Interfaces:
    DataGetter

    public class LocaleSelectionDataGetter
    extends Object
    implements DataGetter
    Get the data for the selectable Locales, so the Freemarker template can create a row of flag images that will select the desired locale. If there are no selectable Locales in runtime.properties, we return an empty map. (selectLocale?? will return false) If the Locale has been forced by runtime.properties, we do the same. If there are selectable Locales, the returned map will contain a structure like this:
     {selectLocale={
       selectLocaleUrl = [the URL for the form action to select a Locale]
       locales={         [a list of maps]
           {               [a map for each Locale]
             code =          [the code for the Locale, e.g. "en_US"]
             label =         [the alt text for the Locale, e.g. "Spanish (Spain)"]
             country =       [the country for the Locale, e.g. "United States"]
             institution =       [the abbreviation for institution, e.g. "UQAM"]
             selected =      [true, if this locale is currently selected]
           }
         }
       }
     }
     
    • Constructor Detail

      • LocaleSelectionDataGetter

        public LocaleSelectionDataGetter​(VitroRequest vreq)
    • Method Detail

      • getData

        public Map<String,​Object> getData​(Map<String,​Object> valueMap)
        Description copied from interface: DataGetter
        Get data. Throwing an Exception is acceptable.
        Specified by:
        getData in interface DataGetter
        Parameters:
        valueMap - any values already generated by data getters or the controller. Might be immutable, and should not be modified within the method.
        Returns:
        data to add to valueMap. Might be empty, but should not be null.