Skip to content
Snippets Groups Projects
Commit 76b46459 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Change RSSFeed's Item's URLs to use IframeURL

Change RSSFeed's Item's URLs to use IframeURL
parent ad4ee80b
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,9 @@ dspace.baseUrl = http://dspacesnj.c3sl.ufpr.br:8080
# DSpace base host URL for mobile access. Include port number etc.
dspace.baseMobileUrl = http://m.dspacesnj.c3sl.ufpr.br:8080
# Base URL of the server hosting the iframe
dspace.iframeBaseURL = http://participatorio.juventude.gov.br/biblioteca
# Name of the site
dspace.name = Biblioteca Digital do Participatório - Observatório Participativo da Juventude
......
......@@ -46,6 +46,9 @@ dspace.mobileUrl = ${dspace.baseMobileUrl}/xmlui
# Name of the site
dspace.name = ${dspace.name}
# Base URL of the server hosting the iframe
dspace.iframeBaseURL = ${dspace.iframeBaseURL}
# Default language for metadata values
default.language = ${default.language}
......
......@@ -173,7 +173,7 @@ public class SyndicationFeed
{
defaultTitle = ConfigurationManager.getProperty("dspace.name");
feed.setDescription(localize(labels, MSG_FEED_DESCRIPTION));
objectURL = resolveURL(request, null);
objectURL = resolveIframeURL(request, null);
logoURL = ConfigurationManager.getProperty("webui.feed.logo.url");
}
else
......@@ -201,7 +201,7 @@ public class SyndicationFeed
podcastFeed = true;
}
}
objectURL = resolveURL(request, dso);
objectURL = resolveIframeURL(request, dso);
if (logo != null)
{
logoURL = urlOfBitstream(request, logo);
......@@ -244,7 +244,7 @@ public class SyndicationFeed
SyndEntry entry = new SyndEntryImpl();
entries.add(entry);
String entryURL = resolveURL(request, item);
String entryURL = resolveIframeURL(request, item);
entry.setLink(entryURL);
entry.setUri(entryURL);
......@@ -562,6 +562,32 @@ public class SyndicationFeed
* @return
*/
private String baseURL = null; // cache the result for null
private String iframeBaseURL = null; // cache the result for null
private String resolveIframeURL(HttpServletRequest request, DSpaceObject dso)
{
// If no object given then just link to the whole repository,
// since no offical handle exists so we have to use local resolution.
if (dso == null)
{
if (iframeBaseURL == null)
{
if (request == null)
{
iframeBaseURL = ConfigurationManager.getProperty("dspace.url");
}
else
{
iframeBaseURL = ConfigurationManager.getProperty("dspace.iframeBaseURL");
iframeBaseURL += "/" + "#" + request.getContextPath();
}
}
return iframeBaseURL;
}
// return a link to handle in repository
return resolveIframeURL(request, null) + "/handle/" + dso.getHandle();
}
private String resolveURL(HttpServletRequest request, DSpaceObject dso)
{
......@@ -612,4 +638,3 @@ public class SyndicationFeed
return (dcv.length > 0) ? dcv[0].value : null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment