Add message key to insertDocument responses

This commit is contained in:
Paul Trudel 2024-05-09 19:54:41 +00:00
parent 4a1c81fa76
commit aebb693379
3 changed files with 7 additions and 5 deletions

View File

@ -218,12 +218,13 @@ public class ResponseBuilder {
return xmlText.toString();
}
public String buildInsertDocumentResponse(String message, String returnCode) {
public String buildInsertDocumentResponse(String messageKey, String message, String returnCode) {
StringWriter xmlText = new StringWriter();
Map<String, Object> data = new HashMap<String, Object>();
data.put("returnCode", returnCode);
data.put("messageKey", messageKey);
data.put("message", message);
processData(getTemplate("insert-document.ftlx"), data, xmlText);

View File

@ -1129,14 +1129,14 @@ class ApiController {
if (uploadDocuments(meeting, true)) {
withFormat {
xml {
render(text: responseBuilder.buildInsertDocumentResponse("Presentation is being uploaded", RESP_CODE_SUCCESS)
render(text: responseBuilder.buildInsertDocumentResponse("documentInserted", "Presentation is being uploaded", RESP_CODE_SUCCESS)
, contentType: "text/xml")
}
}
} else if (meetingService.isMeetingWithDisabledPresentation(meetingId)) {
} else if (meetingService.isMeetingWithDisabledPresentation(meeting.getInternalId())) {
withFormat {
xml {
render(text: responseBuilder.buildInsertDocumentResponse("Presentation feature is disabled, ignoring.",
render(text: responseBuilder.buildInsertDocumentResponse("presentationDisabled", "Presentation feature is disabled, ignoring.",
RESP_CODE_FAILED), contentType: "text/xml")
}
}
@ -1145,7 +1145,7 @@ class ApiController {
log.warn("Meeting with externalID ${externalMeetingId} doesn't exist.")
withFormat {
xml {
render(text: responseBuilder.buildInsertDocumentResponse(
render(text: responseBuilder.buildInsertDocumentResponse("notFound",
"Meeting with id [${externalMeetingId}] not found.", RESP_CODE_FAILED),
contentType: "text/xml")
}

View File

@ -3,6 +3,7 @@
<response>
<#-- Where code is a 'SUCCESS' or 'FAILED' String -->
<returncode>${returnCode}</returncode>
<messageKey>${messageKey}</messageKey>
<message>${message}</message>
</response>
</#compress>