use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class RdfPublicationController method findOnePublicationByMd5.
@ApiMethod(path = "/rdf/publication/{md5}", verb = ApiVerb.GET, description = "Exports one neXtProt publication.", produces = { "text/turtle" })
@RequestMapping("/rdf/publication/{md5}")
public String findOnePublicationByMd5(@ApiPathParam(name = "md5", description = "The md5 of the publication", allowedvalues = { "b240aea6411ebd3cc49099009359df1f" }) @PathVariable("md5") String md5, Model model) {
Publication publication = publicationService.findPublicationByMD5(md5);
model.addAttribute("publication", publication);
model.addAttribute("prefix", true);
model.addAttribute("StringUtils", StringUtils.class);
model.addAttribute("isLargeScale", publicationService.getPublicationStatistics(publication.getPublicationId()).isLargeScale());
return "publication";
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class RdfPublicationController method findAllPublication.
// @ApiMethod(path = "/rdf/publication", verb = ApiVerb.GET, description = "Exports the whole neXtProt publication ordered by year and title.", produces = { "text/turtle"})
@RequestMapping("/rdf/publication")
public void findAllPublication(Map<String, Object> model, HttpServletResponse response, HttpServletRequest request) throws Exception {
Boolean withPrefix = true;
View v = viewResolver.resolveViewName("publication", Locale.ENGLISH);
List<Long> publicationIds = this.publicationService.findAllPublicationIds();
for (Long pubId : publicationIds) {
Publication publication = this.publicationService.findPublicationById(pubId);
model.put("prefix", withPrefix);
model.put("StringUtils", StringUtils.class);
model.put("publication", publication);
model.put("isLargeScale", publicationService.getPublicationStatistics(publication.getPublicationId()).isLargeScale());
v.render(model, request, response);
withPrefix = false;
}
}
use of org.nextprot.api.core.domain.Publication in project nextprot-api by calipho-sib.
the class SeoTagsServiceImpl method getPublicationSeoTags.
@Override
public SeoTags getPublicationSeoTags(String url) {
String[] urlElements = RelativeUrlUtils.getPathElements(url);
int id = Integer.valueOf(urlElements[1]);
// default subpage
String subpage = "proteins";
if (urlElements.length > 2)
subpage = urlElements[2];
String prettySubpage = getPrettyName(subpage);
Publication pub = publicationService.findPublicationById(id);
String title = pub.getTitle() + " - " + prettySubpage;
String h1 = title;
String descr = title;
return new SeoTags(title, descr, h1);
}
Aggregations