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;
}
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 - - - - -");
}
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;
}
Aggregations