public void init(VaadinRequest request)
{
logger.executionTrace();
DatabaseUtil.getSessionFactory(); // Initialize...
final Navigator navigator = new Navigator(this, getContent());
setNavigator(navigator);
navigator.addProvider(new ViewProvider()
{
private static final long serialVersionUID = -3308179049710571790L;
@Override
public String getViewName(String viewAndParameters)
{
if (viewAndParameters == null || viewAndParameters.length() == 0)
return ApplicationView.class.getSimpleName();
String[] parts = viewAndParameters.split("/");
return parts[0];
}
@Override
public View getView(String viewName)
{
final Injector injector = ApplicationFilter.getSecurityInjector();
final String packageName = ApplicationView.class.getPackage().getName();
Class<?> classType = ApplicationView.class;
try
{
classType = Class.forName(packageName + "." + viewName);
}
catch (ClassNotFoundException e)
{
}
return (View) injector.getInstance(classType);
}
});
final String viewName = (ApplicationSecurity.isAuthenticated())
? ApplicationView.NAME
: LoginView.NAME;
navigator.navigateTo(viewName);
}