/** * @param resource * @param response * @param message - optional message to output in the body content */ @Override public void respondConflict( Resource resource, Response response, Request request, String message) { log.debug("respondConflict"); response.setStatus(Response.Status.SC_CONFLICT); contentGenerator.generate(resource, request, response, Status.SC_CONFLICT); }
@Override public PlaceTemplateClassModel generate(GeneratedClassModels context) { if (observations != null && !observations.isOutdated()) return null; CaseAdministration caseAdministration = placeTemplateDesign.getMetadata().getCaseAdministration(); caseAdministration.startRecordingObservations(); PlaceTemplateClassModel model = new PlaceTemplateClassModel(); model.name = placeTemplateDesign.getName(); model.rootPackageName = ((ApplicationDesign) placeTemplateDesign.getMetadata().getCase()).getRootPackageName(); model.technicalNameCapitalized = placeTemplateDesign.getTechnicalNameCapitalized(); model.id = placeTemplateDesign.getMetadata().getUniqueId(); model.isCustomized = placeTemplateDesign.getIsCustomized() == Boolean.TRUE; if (placeTemplateDesign.getOwner() != null) { model.flowname = placeTemplateDesign.getOwner().getTechnicalName(); } model.determineIsDeleted(placeTemplateDesign.isValidForCodeGeneration()); if (placeTemplateDesign.getContent() != null) { model.content = ContentGenerator.generate(placeTemplateDesign.getContent(), model); } model.title = TextGenerator.generate(placeTemplateDesign.getTitle(), model); for (PlaceParameterDesign parameter : placeTemplateDesign.getParameters()) { if (parameter.getEntity() != null) { model.parameters.add(parameter.getEntity().getTechnicalNameCapitalized()); } } this.observations = new ObservationsOutdatedObserver(caseAdministration.stopRecordingObservations(), null); return model; }
@Override public void respondMethodNotAllowed(Resource res, Response response, Request request) { log.debug( "method not allowed. handler: " + this.getClass().getName() + " resource: " + res.getClass().getName()); response.setStatus(Response.Status.SC_METHOD_NOT_ALLOWED); contentGenerator.generate(res, request, response, Status.SC_METHOD_NOT_ALLOWED); }
@Override public void respondServerError(Request request, Response response, String reason) { response.setStatus(Status.SC_INTERNAL_SERVER_ERROR); contentGenerator.generate(null, request, response, Status.SC_INTERNAL_SERVER_ERROR); }
@Override public void respondMethodNotImplemented(Resource resource, Response response, Request request) { response.setStatus(Response.Status.SC_NOT_IMPLEMENTED); contentGenerator.generate(resource, request, response, Status.SC_NOT_IMPLEMENTED); }
@Override public void respondNotFound(Response response, Request request) { response.setStatus(Response.Status.SC_NOT_FOUND); response.setContentTypeHeader("text/html"); contentGenerator.generate(null, request, response, Status.SC_NOT_FOUND); }