/** * Get the i18n message string for a given key and context * * @param key String - name of the key to get the message for * @param c Context having the desired Locale * @return message * String of the message */ public static String getMessage(String key, Context c) { return getMessage(key.trim(), c.getCurrentLocale()); }
SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT_8601, context.getCurrentLocale()); date = format.parse(name); } catch (ParseException e) { DATE_FORMAT_DCDATE, context.getCurrentLocale()); date = format.parse(name); } catch (ParseException e1) { dateformatString, context.getCurrentLocale()); if (date != null) { name = simpleFormat.format(date);
.append("token=").append(rd.getToken()) .toString(); Locale locale = context.getCurrentLocale(); Email bean = Email.getEmail(I18nUtil.getEmailFilename(locale, isRegister ? "register" : "change_password"));
/** * Get the appropriate localized version of the default.license according to language settings * * @param context the current DSpace context * @return fileName * String - localized filename for default.license */ public static String getDefaultLicense(Context context) { Locale locale = context.getCurrentLocale(); String fileName = ""; /** Name of the default license */ final String DEF_LIC_FILE = "default"; final String FILE_TYPE = ".license"; String defsFilename = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + File.separator + "config" + File.separator + DEF_LIC_FILE; fileName = getFilename(locale, defsFilename, FILE_TYPE); return fileName; }
Email email = Email.getEmail(I18nUtil.getEmailFilename(c.getCurrentLocale(), "internal_error"));
if ("continent".equals(datasetQuery.getName())) { value = LocationUtils.getContinentName(value, context .getCurrentLocale()); } else if ("countryCode".equals(datasetQuery.getName())) { value = LocationUtils.getCountryName(value, context .getCurrentLocale()); } else { Query query = datasetQuery.getQueries().get(0);
@Override public void alertUsersOnTaskActivation(Context c, XmlWorkflowItem wfi, String emailTemplate, List<EPerson> epa, String... arguments) throws IOException, SQLException, MessagingException { if (noEMail.containsKey(wfi.getItem().getID())) { // suppress email, and delete key noEMail.remove(wfi.getItem().getID()); } else { Email mail = Email.getEmail(I18nUtil.getEmailFilename(c.getCurrentLocale(), emailTemplate)); for (String argument : arguments) { mail.addArgument(argument); } for (EPerson anEpa : epa) { mail.addRecipient(anEpa.getEmail()); } mail.send(); } }
Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "feedback")); email.addRecipient(ConfigurationManager .getProperty("feedback.recipient"));
Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "feedback")); email.addRecipient(ConfigurationManager .getProperty("feedback.recipient"));
Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "suggest"));
Locale locale = context.getCurrentLocale(); ResourceBundle labels = ResourceBundle.getBundle("Messages", locale);
context.getCurrentLocale(), subInfo.getSubmissionItem() .getCollection(), subInfo.getSubmissionItem().getItem(), subInfo
EPerson eperson = ePersonService.find(context, id); Email adminEmail = Email .getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "registration_notify")); adminEmail.addRecipient(notifyRecipient);
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue"; String licenseText = LicenseUtils.getLicenseText(context .getCurrentLocale(), collection, submission.getItem(), submission.getSubmitter());