use of org.ambraproject.wombat.config.site.RequestMappingContextDictionary in project wombat by PLOS.
the class ArticleFeedView method buildLinks.
private ImmutableList<Link> buildLinks(FeedMetadata feedMetadata, Map<String, ?> article) {
String articleId = (String) article.get("id");
String title = getArticleTitle(article);
Link articleLink = createAtomLink(getArticleLink(feedMetadata, article), title, Optional.empty(), Optional.empty());
Link pdfLink = createAtomLink(feedMetadata.buildLink(link -> link.toPattern(requestMappingContextDictionary, "asset").addQueryParameter("id", articleId + ".PDF").build()), "(PDF) " + title, Optional.of("related"), Optional.of("application/pdf"));
Link xmlLink = createAtomLink(feedMetadata.buildLink(link -> link.toPattern(requestMappingContextDictionary, "asset").addQueryParameter("id", articleId + ".XML").build()), "(XML) " + title, Optional.of("related"), Optional.of("text/xml"));
return ImmutableList.of(articleLink, pdfLink, xmlLink);
}
Aggregations