@Override public Document getDescriptionDoc(String scope) throws IOException { return jDomToW3(getServiceDocument(scope)); }
@Override public List<String> getFormats() { List<String> formats = new ArrayList<>(); // read formats only if enabled if (isEnabled()) { String[] fmts = configurationService.getArrayProperty("websvc.opensearch.formats"); formats = Arrays.asList(fmts); } return formats; }
for (String format : getFormats()) { Element url = new Element("Url", ns).setAttribute("type", getContentType(format)); StringBuilder template = new StringBuilder(); if ("html".equals(format)) { template.append(getBaseSearchUIURL()); } else { template.append(getBaseSearchServiceURL());
@Override public String getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String, String> labels) throws IOException { try { return getResults(context, format, query, totalResults, start, pageSize, scope, results, labels) .outputString(); } catch (FeedException e) { log.error(e.toString(), e); throw new IOException("Unable to generate feed", e); } }
@Override public String getDescription(String scope) { return new XMLOutputter().outputString(getServiceDocument(scope)); }
protected SyndicationFeed getResults(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String, String> labels) { // Encode results in requested format if ("rss".equals(format)) { format = "rss_2.0"; } else if ("atom".equals(format)) { format = "atom_1.0"; } SyndicationFeed feed = new SyndicationFeed(labels.get(SyndicationFeed.MSG_UITYPE)); feed.populate(null, context, scope, results, labels); feed.setType(format); feed.addModule(openSearchMarkup(query, totalResults, start, pageSize)); return feed; }
@Override public Document getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String, String> labels) throws IOException { try { return getResults(context, format, query, totalResults, start, pageSize, scope, results, labels) .outputW3CDom(); } catch (FeedException e) { log.error(e.toString(), e); throw new IOException("Unable to generate feed", e); } }