static Map<String, String> getLocaleMap() {
   List<LabelValueBean> localeList = LocaleHandler.getAvailableLocales();
   Map<String, String> localeMap = new HashMap<String, String>();
   for (LabelValueBean labelValueBean : localeList) {
     localeMap.put(labelValueBean.getValue(), labelValueBean.getLabel());
   }
   return localeMap;
 }
 /**
  * Loads the details for a template
  *
  * @param objectID
  * @return
  */
 static String loadTemplateDef(Integer objectID) {
   List<LabelValueBean> localeList = LocaleHandler.getAvailableLocales();
   TMailTemplateDefBean mailTemplateDefBean = null;
   if (objectID != null) {
     mailTemplateDefBean = mailTemplateDefDAO.loadByPrimaryKey(objectID);
   }
   if (mailTemplateDefBean == null) {
     mailTemplateDefBean = new TMailTemplateDefBean();
     // set template to the first (template type is required, locale is not required)
     mailTemplateDefBean.setIsPlainEmailBool(false);
   }
   return MailTemplatesJSON.encodeMailTemplateDefJSON(mailTemplateDefBean, localeList);
 }