Search in sources :

Example 1 with PageView

use of org.nextprot.api.core.domain.ui.page.PageView in project nextprot-api by calipho-sib.

the class EntryPageServiceImpl method filterXrefInPageView.

@Override
public Entry filterXrefInPageView(String entryName, String pageViewName) {
    Entry entry = entryBuilderService.build(EntryConfig.newConfig(entryName).withEverything());
    PageView pageView = PageViewFactory.valueOf(pageViewName.toUpperCase()).getPageView();
    List<DbXref> xrefs = pageView.getFurtherExternalLinksXrefs(entry);
    entry.setXrefs(xrefs);
    entry.setAnnotations(Collections.emptyList());
    entry.setPublications(Collections.emptyList());
    entry.setExperimentalContexts(Collections.emptyList());
    entry.setIdentifiers(Collections.emptyList());
    entry.setInteractions(Collections.emptyList());
    entry.setEnzymes(Collections.emptyList());
    return entry;
}
Also used : PageView(org.nextprot.api.core.domain.ui.page.PageView) DbXref(org.nextprot.api.core.domain.DbXref) Entry(org.nextprot.api.core.domain.Entry) ValidEntry(org.nextprot.api.core.service.annotation.ValidEntry)

Example 2 with PageView

use of org.nextprot.api.core.domain.ui.page.PageView in project nextprot-api by calipho-sib.

the class PageViewTest method shouldDoIt.

@Ignore
@Test
public void shouldDoIt() throws Exception {
    // String entryName="NX_Q8WZ42";  // TITIN, 1st most annotated protein: 147ms processing
    // String entryName="NX_Q5VST9";  // OBSCN, 3rd most annotated protein:  25ms processing
    String entryName = "NX_P02649";
    // String entryName="NX_P52701";
    // String entryName="NX_P01308";
    Entry entry = entryBuilderService.build(EntryConfig.newConfig(entryName).withEverything());
    System.out.println("- - - - - before - - - - -");
    System.out.println("annot categ : " + entry.getAnnotationsByCategory().size());
    System.out.println("annot count : " + entry.getAnnotations().size());
    System.out.println("xrefs       : " + entry.getXrefs().size());
    showXref(entry, "UniProt");
    PageView pageDef = new SequencePageView();
    long t0 = System.currentTimeMillis();
    List<DbXref> xrefs = pageDef.getFurtherExternalLinksXrefs(entry);
    t0 = System.currentTimeMillis() - t0;
    System.out.println("- - - - - after  - - - - -");
    showXref(xrefs);
    System.out.println("xrefs       : " + xrefs.size());
    System.out.println("proc time ms: " + t0);
    System.out.println("- - - - - end  - - - - -");
}
Also used : SequencePageView(org.nextprot.api.core.domain.ui.page.impl.SequencePageView) PageView(org.nextprot.api.core.domain.ui.page.PageView) DbXref(org.nextprot.api.core.domain.DbXref) Entry(org.nextprot.api.core.domain.Entry) SequencePageView(org.nextprot.api.core.domain.ui.page.impl.SequencePageView) Ignore(org.junit.Ignore) WebIntegrationBaseTest(org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest) Test(org.junit.Test)

Example 3 with PageView

use of org.nextprot.api.core.domain.ui.page.PageView in project nextprot-api by calipho-sib.

the class EntryPageServiceImpl method hasContentForPageDisplay.

@Cacheable(value = "page-display", key = "#entryName")
@Override
public Map<String, Boolean> hasContentForPageDisplay(@ValidEntry String entryName) {
    Entry entry = entryBuilderService.build(EntryConfig.newConfig(entryName).withEverything());
    Map<String, Boolean> map = new HashMap<>();
    for (PageViewFactory page : PageViewFactory.values()) {
        PageView pv = page.getPageView();
        map.put(pv.getLabel(), pv.doDisplayPage(entry));
    }
    return map;
}
Also used : PageView(org.nextprot.api.core.domain.ui.page.PageView) Entry(org.nextprot.api.core.domain.Entry) ValidEntry(org.nextprot.api.core.service.annotation.ValidEntry) HashMap(java.util.HashMap) PageViewFactory(org.nextprot.api.core.domain.ui.page.PageViewFactory) Cacheable(org.springframework.cache.annotation.Cacheable)

Aggregations

Entry (org.nextprot.api.core.domain.Entry)3 PageView (org.nextprot.api.core.domain.ui.page.PageView)3 DbXref (org.nextprot.api.core.domain.DbXref)2 ValidEntry (org.nextprot.api.core.service.annotation.ValidEntry)2 HashMap (java.util.HashMap)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 PageViewFactory (org.nextprot.api.core.domain.ui.page.PageViewFactory)1 SequencePageView (org.nextprot.api.core.domain.ui.page.impl.SequencePageView)1 WebIntegrationBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest)1 Cacheable (org.springframework.cache.annotation.Cacheable)1