public IsisViewer doCreateViewer() {
return new EmbeddedWebViewer() {
@Override
public WebAppSpecification getWebAppSpecification() {
final WebAppSpecification webAppSpec = new WebAppSpecification();
webAppSpec.addContextParams("isis.viewers", "html");
webAppSpec.addFilterSpecification(IsisSessionFilter.class, MapUtils.asMap(IsisSessionFilter.RESTRICTED_KEY, LOGON_PAGE_MAPPED), DYNAMIC_CONTENT);
webAppSpec.addServletSpecification(LogonServlet.class, LOGON_PAGE_MAPPED);
webAppSpec.addServletSpecification(ControllerServlet.class, DYNAMIC_CONTENT);
webAppSpec.addFilterSpecification(ResourceCachingFilter.class, MapUtils.asMap("CacheTime", "86400"), STATIC_CONTENT);
webAppSpec.addServletSpecification(ResourceServlet.class, STATIC_CONTENT);
final String resourceBaseDir = getConfiguration().getString(HtmlViewerConstants.VIEWER_HTML_RESOURCE_BASE_KEY);
if (resourceBaseDir != null) {
webAppSpec.addResourcePath(resourceBaseDir);
}
webAppSpec.addResourcePath("./src/main/resources");
webAppSpec.addResourcePath("./src/main/webapp");
webAppSpec.addResourcePath("./web");
webAppSpec.addResourcePath(".");
webAppSpec.setLogHint("open a web browser and browse to logon.app to connect");
return webAppSpec;
}
};
}