/** * Get the appropriate localized version of submission-forms.xml according to language settings * * @param locale Locale, the local to get the submission-forms.xml for * @return String - localized filename for submission-forms.xml */ public static String getInputFormsFileName(Locale locale) { /** Name of the form definition XML file */ String fileName = ""; final String FORM_DEF_FILE = "submission-forms"; final String FILE_TYPE = ".xml"; String defsFilename = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + File.separator + "config" + File.separator + FORM_DEF_FILE; fileName = getFilename(locale, defsFilename, FILE_TYPE); return fileName; }
/** * Get the appropriate localized version of an email template according to language settings * * @param locale Locale for this request * @param name String - base name of the email template * @return templateName * String - localized filename of an email template */ public static String getEmailFilename(Locale locale, String name) { String templateName = ""; String templateFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + File.separator + "config" + File.separator + "emails" + File.separator + name; templateName = getFilename(locale, templateFile, ""); return templateName; }
/** * 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; }