mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
Add URL localisation option to RSS feed feature
git-svn-id: http://scm.dspace.org/svn/repo/trunk@1356 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -713,6 +713,8 @@ dstat-report-monthly
|
||||
set the value of this property to that format, selecting only from the list of canonical names provided. If you wish multiple formats,
|
||||
set the value to a comma-separated list of canonical names. Each format will appear as a distinct icon and link
|
||||
in the community and collection home page, as well as an 'autodiscovery' link in the page header.</p>
|
||||
<p><code>webui.feed.localresolve = false</code></p>
|
||||
<p>By default, the RSS feed will return global handle server-based URLs to items, collections and communities (e.g. http://hdl.handle.net/123456789/1). This means if you have not registered your DSpace installation with the CNRI Handle Server (e.g. development or testing instance) the URLs returned by the feed will return an error if accessed. Setting <code>webui.feed.localresolve = true</code> will result in the RSS feed returning localised URLs (e.g. http://myserver.myorg/handle/123456789/1). If <code>webui.feed.localresolve</code> is set to <code>false</code> or not present the default global handle URL form is used.</p>
|
||||
<hr>
|
||||
|
||||
<address>
|
||||
|
@@ -257,7 +257,9 @@ public class FeedServlet extends DSpaceServlet
|
||||
throws IOException, SQLException
|
||||
{
|
||||
// container-level elements
|
||||
String objectUrl = HandleManager.getCanonicalForm(dso.getHandle());
|
||||
String objectUrl = ConfigurationManager.getBooleanProperty("webui.feed.localresolve")
|
||||
? HandleManager.resolveToURL(context, dso.getHandle())
|
||||
: HandleManager.getCanonicalForm(dso.getHandle());
|
||||
String dspaceUrl = ConfigurationManager.getProperty("dspace.url");
|
||||
String type = null;
|
||||
String description = null;
|
||||
@@ -336,11 +338,15 @@ public class FeedServlet extends DSpaceServlet
|
||||
*/
|
||||
private com.sun.syndication.feed.rss.Item itemFromDSpaceItem(Context context,
|
||||
Item dspaceItem)
|
||||
throws SQLException
|
||||
{
|
||||
com.sun.syndication.feed.rss.Item rssItem =
|
||||
new com.sun.syndication.feed.rss.Item();
|
||||
|
||||
String itHandle = HandleManager.getCanonicalForm(dspaceItem.getHandle());
|
||||
String itHandle = ConfigurationManager.getBooleanProperty("webui.feed.localresolve")
|
||||
? HandleManager.resolveToURL(context, dspaceItem.getHandle())
|
||||
: HandleManager.getCanonicalForm(dspaceItem.getHandle());
|
||||
|
||||
rssItem.setLink(itHandle);
|
||||
|
||||
String title = getDC(dspaceItem, "title", null, Item.ANY);
|
||||
|
Reference in New Issue
Block a user