private URI updatePortfolio(String name, DocumentVisibility visibility, PortfolioDocument doc) { doc.getPortfolio().setName(name); doc.setVisibility(visibility); doc = data().getPortfolioMaster().update(doc); data().setPortfolio(doc); URI uri = WebPortfolioResource.uri(data()); return uri; }
// ------------------------------------------------------------------------- @DELETE @Produces(MediaType.TEXT_HTML) public Response deleteHTML() { PortfolioDocument doc = data().getPortfolio(); if (doc.isLatest() == false) { return Response.status(Status.FORBIDDEN).entity(getHTML()).build(); } data().getPortfolioMaster().remove(doc.getUniqueId()); URI uri = WebPortfolioResource.uri(data()); return Response.seeOther(uri).build(); }