use of org.activityinfo.server.login.model.RootPageModel in project activityinfo by bedatadriven.
the class HostController method getHostPage.
@GET
@Produces(MediaType.TEXT_HTML)
@LogException(emailAlert = true)
public Response getHostPage(@Context UriInfo uri, @Context HttpServletRequest req, @QueryParam("redirect") boolean redirect) throws Exception {
if (!authProvider.isAuthenticated()) {
// Otherwise, go to the default ActivityInfo root page
return Response.ok(new RootPageModel().asViewable()).type(MediaType.TEXT_HTML).cacheControl(CacheControl.valueOf("no-cache")).build();
}
if (redirect) {
return Response.seeOther(uri.getAbsolutePathBuilder().replacePath(ENDPOINT).build()).build();
}
String appUri = uri.getAbsolutePathBuilder().replaceQuery("").build().toString();
HostPageModel model = new HostPageModel(appUri);
model.setAppCacheEnabled(checkAppCacheEnabled(req));
return Response.ok(model.asViewable()).type(MediaType.TEXT_HTML).cacheControl(CacheControl.valueOf("no-cache")).build();
}
Aggregations