Search in sources :

Example 6 with NextProtNews

use of org.nextprot.api.web.domain.NextProtNews in project nextprot-api by calipho-sib.

the class GitHubServiceUnitTest method shouldReturnNullIfDateIsNotInCorrectFormat.

@Test
public void shouldReturnNullIfDateIsNotInCorrectFormat() throws Exception {
    NextProtNews n = GitHubServiceImpl.parseGitHubNewsFilePath("2014/August/25/Google OAuth Support.md");
    assertTrue(n == null);
}
Also used : NextProtNews(org.nextprot.api.web.domain.NextProtNews) WebUnitBaseTest(org.nextprot.api.web.dbunit.base.mvc.WebUnitBaseTest) Test(org.junit.Test)

Example 7 with NextProtNews

use of org.nextprot.api.web.domain.NextProtNews 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

NextProtNews (org.nextprot.api.web.domain.NextProtNews)7 Test (org.junit.Test)3 WebUnitBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebUnitBaseTest)3 DateFormat (java.text.DateFormat)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Cacheable (org.springframework.cache.annotation.Cacheable)2 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 GHRepository (org.kohsuke.github.GHRepository)1 GHTree (org.kohsuke.github.GHTree)1 GHTreeEntry (org.kohsuke.github.GHTree.GHTreeEntry)1 GitHub (org.kohsuke.github.GitHub)1 NextProtException (org.nextprot.api.commons.exception.NextProtException)1 SeoTagsAndUrl (org.nextprot.api.web.seo.domain.SeoTagsAndUrl)1 SitemapUrl (org.nextprot.api.web.seo.domain.SitemapUrl)1 SitemapUrlSet (org.nextprot.api.web.seo.domain.SitemapUrlSet)1