Remove references to UI type from OpenSearch / RSS feeds

(cherry picked from commit 47b79bb2cb)
This commit is contained in:
Tim Donohue
2024-05-13 15:15:53 -05:00
committed by github-actions[bot]
parent b3a4571d4c
commit 3b1cf3e35e
3 changed files with 3 additions and 17 deletions

View File

@@ -155,7 +155,7 @@ public class OpenSearchServiceImpl implements OpenSearchService {
format = "atom_1.0";
}
SyndicationFeed feed = new SyndicationFeed(labels.get(SyndicationFeed.MSG_UITYPE));
SyndicationFeed feed = new SyndicationFeed();
feed.populate(null, context, scope, results, labels);
feed.setType(format);
feed.addModule(openSearchMarkup(query, totalResults, start, pageSize));

View File

@@ -84,11 +84,6 @@ public class SyndicationFeed {
public static final String MSG_FEED_TITLE = "feed.title";
public static final String MSG_FEED_DESCRIPTION = "general-feed.description";
public static final String MSG_METADATA = "metadata.";
public static final String MSG_UITYPE = "ui.type";
// UI keywords
public static final String UITYPE_XMLUI = "xmlui";
public static final String UITYPE_JSPUI = "jspui";
// default DC fields for entry
protected String defaultTitleField = "dc.title";
@@ -145,10 +140,6 @@ public class SyndicationFeed {
// the feed object we are building
protected SyndFeed feed = null;
// memory of UI that called us, "xmlui" or "jspui"
// affects Bitstream retrieval URL and I18N keys
protected String uiType = null;
protected HttpServletRequest request = null;
protected CollectionService collectionService;
@@ -157,12 +148,9 @@ public class SyndicationFeed {
/**
* Constructor.
*
* @param ui either "xmlui" or "jspui"
*/
public SyndicationFeed(String ui) {
public SyndicationFeed() {
feed = new SyndFeedImpl();
uiType = ui;
ContentServiceFactory contentServiceFactory = ContentServiceFactory.getInstance();
itemService = contentServiceFactory.getItemService();
collectionService = contentServiceFactory.getCollectionService();
@@ -518,8 +506,7 @@ public class SyndicationFeed {
protected String urlOfBitstream(HttpServletRequest request, Bitstream logo) {
String name = logo.getName();
return resolveURL(request, null) +
(uiType.equalsIgnoreCase(UITYPE_XMLUI) ? "/bitstream/id/" : "/retrieve/") +
logo.getID() + "/" + (name == null ? "" : name);
"/bitstreams/" + logo.getID() + "/download";
}
protected String baseURL = null; // cache the result for null

View File

@@ -285,7 +285,6 @@ public class OpenSearchController {
labelMap.put(SyndicationFeed.MSG_UNTITLED, "notitle");
labelMap.put(SyndicationFeed.MSG_LOGO_TITLE, "logo.title");
labelMap.put(SyndicationFeed.MSG_FEED_DESCRIPTION, "general-feed.description");
labelMap.put(SyndicationFeed.MSG_UITYPE, SyndicationFeed.UITYPE_JSPUI);
for (String selector : SyndicationFeed.getDescriptionSelectors()) {
labelMap.put("metadata." + selector, selector);
}