- };
-
- protected void makeInitialResponse(Request aRequest, Session aSession, Response aResponse) throws SessionExc, SessionFailure {
- aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.comment.EditTemplate"));
- };
-
- protected void makeResponse(Request aRequest, Session aSession, Response aResponse, List anErrors) throws SessionExc, SessionFailure {
- aResponse.setResponseValue("errors", anErrors);
- aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.comment.EditTemplate"));
- };
-
- protected void makeFinalResponse(Request aRequest, Session aSession, Response aResponse) throws SessionExc, SessionFailure {
- aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.comment.DoneTemplate"));
- };
-
- protected void makeErrorResponse(Request aRequest, Session aSession, Response aResponse, Throwable anError) throws SessionExc, SessionFailure {
- anError.printStackTrace();
- Throwable rootCause = ExceptionFunctions.traceCauseException(anError);
-
- if (rootCause instanceof DuplicateCommentExc)
- aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.comment.DupeTemplate"));
- if (rootCause instanceof ModuleMediaType.UnsupportedMimeTypeExc) {
- aResponse.setResponseValue("mimetype", ((ModuleMediaType.UnsupportedMimeTypeExc) rootCause).getMimeType());
- aResponse.setResponseGenerator(configuration.getString("Localizer.OpenSession.comment.UnsupportedMediaTemplate"));
- }
- else
- super.makeErrorResponse(aRequest, aSession, aResponse, anError);
- };