use of org.nextprot.api.web.seo.domain.SeoTagsAndUrl in project nextprot-api by calipho-sib.
the class SeoTagsServiceImpl method getGitHubSeoTags.
@Override
public List<SeoTagsAndUrl> getGitHubSeoTags() {
try {
String content = gitHubService.getPage("json-config", "seotags");
ObjectMapper mapper = new ObjectMapper();
SeoTagsAndUrl[] tags = mapper.readValue(content, SeoTagsAndUrl[].class);
return Arrays.asList(tags);
} catch (Exception e) {
Logger.error("Could not get hard coded SEO tags from github");
return new ArrayList<SeoTagsAndUrl>();
}
}
use of org.nextprot.api.web.seo.domain.SeoTagsAndUrl in project nextprot-api by calipho-sib.
the class SitemapServiceImpl method getSitemapUrlSet.
@Override
public SitemapUrlSet getSitemapUrlSet() {
// TODO set this elsewhere !
String base = "https://www.nextprot.org";
SitemapUrlSet urlSet = new SitemapUrlSet();
// news urls
for (NextProtNews n : githubService.getNews()) {
urlSet.add(new SitemapUrl(base + "/news/" + n.getUrl()));
}
// other application urls (help, about, home, portals, ...)
for (SeoTagsAndUrl tag : seoTagService.getGitHubSeoTags()) {
// blocked by robots.txt, thus removed from sitemap
if ("/user/proteins/lists".equals(tag.getUrl()))
continue;
// blocked by robots.txt, thus removed from sitemap
if ("/user/queries".equals(tag.getUrl()))
continue;
urlSet.add(new SitemapUrl(base + tag.getUrl()));
}
// entry function urls
Set<String> acs = masterIdentifierService.findUniqueNames();
for (String ac : acs) {
urlSet.add(new SitemapUrl(base + "/entry/" + ac));
}
return urlSet;
}
Aggregations