(Claudia Juergen)

SF Patch #1722557 for SF Bug #1549290 Suggest Features uses hard coded strings

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1949 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Claudia Juergen
2007-05-21 11:16:57 +00:00
parent 24422f5a05
commit 027b66733d
5 changed files with 29 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
(Claudia Juergen) (Claudia Juergen)
- SF Patch 1450491 i18n configurable multilingualism support - SF Patch #1722557 for SF Bug #1549290 Suggest Features uses hard coded strings
- SF Patch #1450491 i18n configurable multilingualism support
1.4.2 beta 1.4.2 beta
=========== ===========

View File

@@ -609,11 +609,7 @@ webui.suggest.enable = false
# Enable only, if the user is logged in. # Enable only, if the user is logged in.
# If not set the default value is false # If not set the default value is false
# webui.suggest.loggedinusers.only = true # webui.suggest.loggedinusers.only = true
#
# default name of recommender - replaced by user input if present
webui.suggest.sender = A DSpace user
# default name of recipient - replaced by user input if present
webui.suggest.recipient = colleague
#### Author and subject links #### #### Author and subject links ####
# link author names back to browse-by-author (if not set, defaults to true) # link author names back to browse-by-author (if not set, defaults to true)

View File

@@ -1203,6 +1203,8 @@ org.dspace.app.webui.servlet.FeedServlet.search.name
# The following takes in the feed type (collection or community) # The following takes in the feed type (collection or community)
org.dspace.app.webui.servlet.FeedServlet.search.title = The {0}''s search engine org.dspace.app.webui.servlet.FeedServlet.search.title = The {0}''s search engine
org.dspace.app.webui.servlet.FeedServlet.search.title.default = The DSpace search engine org.dspace.app.webui.servlet.FeedServlet.search.title.default = The DSpace search engine
org.dspace.app.webui.servlet.SuggestServlet.recipient = colleague
#org.dspace.app.webui.servlet.SuggestServlet.sender = A DSpace user
org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.badelemchar = The element cannot contain periods, underscores or spaces. org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.badelemchar = The element cannot contain periods, underscores or spaces.
org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.badqualchar = The qualifier cannot contain periods, underscores or spaces. org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.badqualchar = The qualifier cannot contain periods, underscores or spaces.
org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.createfailed = The requested field could not be created due to an already existing field with an identical name. org.dspace.app.webui.servlet.admin.MetadataFieldRegistryServlet.createfailed = The requested field could not be created due to an already existing field with an identical name.

View File

@@ -1013,11 +1013,14 @@ stat-report-monthly
in <code>dspace.cfg</code>:</p> in <code>dspace.cfg</code>:</p>
<p><code>webui.suggest.enable = true</code></p> <p><code>webui.suggest.enable = true</code></p>
<p>Set the value of this property to <code>true</code> to expose the link to the recommendation form. If <code>false</code>, the link will not display.</p> <p>Set the value of this property to <code>true</code> to expose the link to the recommendation form. If <code>false</code>, the link will not display.</p>
<p><code>webui.suggest.sender = A DSpace user</code></p> <p><code>webui.suggest.loggedinusers.only = true</code></p>
Enables only logged in users to suggest an item. The default value is false.
<p>Messages.properties:</p>
<p><code>org.dspace.app.webui.servlet.SuggestServlet.sender = A DSpace user</code></p>
<p>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 <p>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 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.</p> the 'reply-to' email header to the e-person's address.</p>
<p><code>webui.suggest.recipient = colleague</code></p> <p><code>org.dspace.app.webui.servlet.SuggestServlet.recipient = colleague</code></p>
<p>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.</p> <p>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.</p>
<p>The wording and layout of the email message is governed by the template file <code><i>[dspace]</i>/config/emails/suggest</code>. You may edit this file <p>The wording and layout of the email message is governed by the template file <code><i>[dspace]</i>/config/emails/suggest</code>. 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 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

View File

@@ -43,6 +43,7 @@ package org.dspace.app.webui.servlet;
import java.io.IOException; import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Date; import java.util.Date;
import java.util.MissingResourceException;
import javax.mail.MessagingException; import javax.mail.MessagingException;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -143,7 +144,15 @@ public class SuggestServlet extends DSpaceServlet
String recipName = request.getParameter("recip_name"); String recipName = request.getParameter("recip_name");
if (recipName == null || "".equals(recipName)) 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"); String senderName = request.getParameter("sender_name");
if (senderName == null || "".equals(senderName) ) if (senderName == null || "".equals(senderName) )
@@ -155,8 +164,15 @@ public class SuggestServlet extends DSpaceServlet
} }
else else
{ {
// use configured default try
senderName = ConfigurationManager.getProperty("webui.suggest.sender"); {
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"); String senderAddr = request.getParameter("sender_email");