use of gov.usgs.cida.coastalhazards.jpa.ItemManager in project coastal-hazards by USGS-CIDA.
the class TutorialRouter method showActionCenterTutorial.
/**
* Sends the client to the item info page with a header to notify the client
* to start a tour
*
* @param id
* @return
*/
@GET
@Produces(MediaType.TEXT_HTML)
@Path("/item/{itemId}")
public Response showActionCenterTutorial(@PathParam("itemId") String id) {
Response response;
Map<String, Object> map;
Item item;
try (ItemManager mgr = new ItemManager()) {
item = mgr.load(id);
}
if (item == null) {
response = Response.status(Response.Status.NOT_FOUND).build();
} else {
map = new HashMap<>();
map.put("item", item);
map.put("tutorial", "true");
response = Response.ok(new Viewable("/WEB-INF/jsp/ui/back/index.jsp", map)).build();
}
return response;
}
Aggregations