From 027b66733d43660e028ba396a7fc4138d86dda25 Mon Sep 17 00:00:00 2001
From: Claudia Juergen dspace.cfg:
webui.suggest.enable = true
Set the value of this property to true to expose the link to the recommendation form. If false, the link will not display.
webui.suggest.sender = A DSpace user
webui.suggest.loggedinusers.only = true
Messages.properties:
+org.dspace.app.webui.servlet.SuggestServlet.sender = A DSpace user
The form includes an optional field for the name of the person making the recommendation. The value of this property will be used if the sender is not specified. Note that if the user has been authenticated to DSpace, the e-person record will be used to set the default value of this field, and will also be used to set the 'reply-to' email header to the e-person's address.
-webui.suggest.recipient = colleague
org.dspace.app.webui.servlet.SuggestServlet.recipient = colleague
In addition to the required destination email address, the form includes an optional field for the name of person to whom the recommendation is to be sent. The value of this property will be used if the recipient name is not specified.
The wording and layout of the email message is governed by the template file [dspace]/config/emails/suggest. You may edit this file
to alter the language, layout, type, or amount of information contained in the email, but note that the values passed to the template are limited to those enumerated at the
diff --git a/dspace/src/org/dspace/app/webui/servlet/SuggestServlet.java b/dspace/src/org/dspace/app/webui/servlet/SuggestServlet.java
index 6d6b304504..942cc08852 100644
--- a/dspace/src/org/dspace/app/webui/servlet/SuggestServlet.java
+++ b/dspace/src/org/dspace/app/webui/servlet/SuggestServlet.java
@@ -43,6 +43,7 @@ package org.dspace.app.webui.servlet;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Date;
+import java.util.MissingResourceException;
import javax.mail.MessagingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -143,7 +144,15 @@ public class SuggestServlet extends DSpaceServlet
String recipName = request.getParameter("recip_name");
if (recipName == null || "".equals(recipName))
{
- recipName = ConfigurationManager.getProperty("webui.suggest.recipient");
+ try
+ {
+ recipName = I18nUtil.getMessage("org.dspace.app.webui.servlet.SuggestServlet.recipient", context);
+ }
+ catch (MissingResourceException e)
+ {
+ log.warn(LogManager.getHeader(context, "show_suggest_form", "Missing Resource: org.dspace.app.webui.servlet.SuggestServlet.sender"));
+ recipName = "colleague";
+ }
}
String senderName = request.getParameter("sender_name");
if (senderName == null || "".equals(senderName) )
@@ -155,8 +164,15 @@ public class SuggestServlet extends DSpaceServlet
}
else
{
- // use configured default
- senderName = ConfigurationManager.getProperty("webui.suggest.sender");
+ try
+ {
+ senderName = I18nUtil.getMessage("org.dspace.app.webui.servlet.SuggestServlet.sender", context);
+ }
+ catch (MissingResourceException e)
+ {
+ log.warn(LogManager.getHeader(context, "show_suggest_form", "Missing Resource: org.dspace.app.webui.servlet.SuggestServlet.sender"));
+ senderName = "A DSpace User";
+ }
}
}
String senderAddr = request.getParameter("sender_email");