ViewContext commentsViewContext = new ViewContext();
commentsViewContext.setApp(app);
EntityDisplayTablePage commentsPage = new EntityDisplayTablePage(
commentsModelContext, commentsViewContext);
Link commentsLink = new PageLink("commentsLink", commentsPage);
add(commentsLink);
ModelContext questionsModelContext = new ModelContext();
questionsModelContext.setDomainModel(app.getDomainModel());
Questions questions = (Questions) app.getEntry("Questions");
questionsModelContext.setEntities(questions);
ViewContext questionsViewContext = new ViewContext();
questionsViewContext.setApp(app);
EntityDisplayTablePage questionsPage = new EntityDisplayTablePage(
questionsModelContext, questionsViewContext);
Link questionsLink = new PageLink("questionsLink", questionsPage);
add(questionsLink);
ModelContext presentationsModelContext = new ModelContext();
presentationsModelContext.setDomainModel(app.getDomainModel());
Presentations presentations = (Presentations) app
.getEntry("Presentations");
Presentations orderedPresentations = presentations
.getPresentationsOrderedByTitle();
presentationsModelContext.setEntities(orderedPresentations);
ViewContext presentationsViewContext = new ViewContext();
presentationsViewContext.setApp(app);
EntityDisplayTablePage orderedPresentationsPage = new EntityDisplayTablePage(
presentationsModelContext, presentationsViewContext);
Link orderedPresentationsLink = new PageLink("presentationsLink",
orderedPresentationsPage);
add(orderedPresentationsLink);
Link loginLink = new PageLink("login", LoginPage.class);
add(loginLink);
Link logoutLink = new Link("logout") {
static final long serialVersionUID = 300331L;
public void onClick() {
getAppSession().invalidate();
setResponsePage(HomePage.class);
}
};
add(logoutLink);
if (getAppSession().isMemberLoggedIn()) {
loginLink.setVisible(false);
} else {
logoutLink.setVisible(false);
}
if (!app.getModelConfig().isLogin()) {
loginLink.setVisible(false);
}
ModelContext dmLiteEntryPageModelContext = new ModelContext();
dmLiteEntryPageModelContext.setDomainModel(app.getDomainModel());
ViewContext dmLiteEntryPageViewContext = new ViewContext();
dmLiteEntryPageViewContext.setApp(app);
WebPage dmLiteEntryPage = new DmLiteEntryPage(
dmLiteEntryPageModelContext, dmLiteEntryPageViewContext);
Link dmLiteEntryLink = new PageLink("dmLiteEntry", dmLiteEntryPage);
add(dmLiteEntryLink);
ModelContext countryLanguageModelContext = new ModelContext();
countryLanguageModelContext.setDomainModel(app.getDomainModel());
CountryLanguages countryLanguages = (CountryLanguages) app