Search in sources :

Example 1 with SeoTagsAndUrl

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>();
    }
}
Also used : SeoTagsAndUrl(org.nextprot.api.web.seo.domain.SeoTagsAndUrl) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 2 with 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;
}
Also used : SitemapUrl(org.nextprot.api.web.seo.domain.SitemapUrl) SeoTagsAndUrl(org.nextprot.api.web.seo.domain.SeoTagsAndUrl) NextProtNews(org.nextprot.api.web.domain.NextProtNews) SitemapUrlSet(org.nextprot.api.web.seo.domain.SitemapUrlSet)

Aggregations

SeoTagsAndUrl (org.nextprot.api.web.seo.domain.SeoTagsAndUrl)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 NextProtNews (org.nextprot.api.web.domain.NextProtNews)1 SitemapUrl (org.nextprot.api.web.seo.domain.SitemapUrl)1 SitemapUrlSet (org.nextprot.api.web.seo.domain.SitemapUrlSet)1