-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
another solution - maybe works in prod
- Loading branch information
koehlers
committed
Mar 7, 2018
1 parent
c0bed54
commit 8e0835b
Showing
1 changed file
with
21 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,23 +72,16 @@ public class HpowebUI extends UI { | |
private final static Object block = new Object(); | ||
|
||
private static HpData hpData = null; | ||
private static GoogleAnalyticsTracker tracker; | ||
|
||
private static Label version; | ||
|
||
private static Label copyright; | ||
|
||
private static Link feedback; | ||
|
||
private static LazyComboBox<SearchableEntity> searchBar; | ||
|
||
public static Container gridContainer; | ||
|
||
@WebServlet(value = "/*", asyncSupported = true) | ||
@VaadinServletConfiguration(productionMode = false, ui = HpowebUI.class) | ||
public static class Servlet extends VaadinServlet { | ||
} | ||
|
||
private static String ontologyVersion; | ||
|
||
private GoogleAnalyticsTracker tracker; | ||
|
||
@Override | ||
protected void init(VaadinRequest request) { | ||
|
||
|
@@ -111,21 +104,12 @@ protected void init(VaadinRequest request) { | |
} | ||
} | ||
|
||
String ontologyVersion; | ||
if (doParseHpo) { | ||
ontologyVersion = hpData.getExtOwlOntology().getOntologyVersionIri().toString(); | ||
} | ||
else { | ||
ontologyVersion = "some ontology version here"; | ||
} | ||
version = new Label("Ontology version: " + ontologyVersion); | ||
copyright = new Label("Copyright 2018 - Sebastian Köhler & The Phenomics Group Berlin"); | ||
feedback = new Link("Contact: [email protected]", | ||
new ExternalResource("http:https://phenomics.github.io/")); | ||
|
||
SearchBarFactory searchbarFactory = new SearchBarFactory(); | ||
searchBar = searchbarFactory.getSearchBar(hpData); | ||
searchBar.setWidth("100%"); | ||
|
||
/* | ||
* Set the site url template | ||
|
@@ -142,12 +126,11 @@ protected void init(VaadinRequest request) { | |
putParametersIntoUriFragment(request); | ||
} | ||
uriFragment = page.getUriFragment(); | ||
|
||
/************************ | ||
* Now the content displayed | ||
*/ | ||
|
||
gridContainer = refreshContent(uriFragment); | ||
|
||
Container gridContainer = getContentContainer(uriFragment); | ||
setContent(gridContainer); | ||
|
||
page.addUriFragmentChangedListener(new UriFragmentChangedListener() { | ||
|
@@ -156,8 +139,8 @@ public void uriFragmentChanged(UriFragmentChangedEvent source) { | |
System.out.println("got a change in uri fragment here"); | ||
Page page = HpowebUI.get().getPage(); | ||
String uriFragment = page.getUriFragment(); | ||
gridContainer = refreshContent(uriFragment); | ||
setContent(gridContainer); | ||
Container newGridContainer = getContentContainer(uriFragment); | ||
setContent(newGridContainer); | ||
} | ||
}); | ||
|
||
|
@@ -167,9 +150,15 @@ public void uriFragmentChanged(UriFragmentChangedEvent source) { | |
* @param uriFragment | ||
* @return | ||
*/ | ||
public static Container refreshContent(String uriFragment) { | ||
public static Container getContentContainer(String uriFragment) { | ||
|
||
SearchBarFactory searchbarFactory = new SearchBarFactory(); | ||
LazyComboBox<SearchableEntity> searchBar = searchbarFactory.getSearchBar(hpData); | ||
searchBar.setWidth("100%"); | ||
|
||
Container gridContainer = new Container(); | ||
|
||
gridContainer = new Container(); | ||
gridContainer.removeAllComponents(); | ||
|
||
// just a line that disappears on small devices | ||
addHorizontalLine(gridContainer); | ||
|
@@ -218,6 +207,11 @@ else if (dataProvider instanceof IGeneDataProvider) { | |
|
||
} | ||
|
||
Label version = new Label("Ontology version: " + ontologyVersion); | ||
Label copyright = new Label("Copyright 2018 - Sebastian Köhler & The Phenomics Group Berlin"); | ||
Link feedback = new Link("Contact: [email protected]", | ||
new ExternalResource("http:https://phenomics.github.io/")); | ||
|
||
// just a line that disappears on small devices | ||
addHorizontalLine(gridContainer); | ||
addLabelRow(gridContainer, version); | ||
|