From aebb69337928e07b4eb0df2f4c1c7188b957fbbb Mon Sep 17 00:00:00 2001 From: Paul Trudel Date: Thu, 9 May 2024 19:54:41 +0000 Subject: [PATCH] Add message key to insertDocument responses --- .../java/org/bigbluebutton/api/util/ResponseBuilder.java | 3 ++- .../bigbluebutton/web/controllers/ApiController.groovy | 8 ++++---- .../main/webapp/WEB-INF/freemarker/insert-document.ftlx | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/util/ResponseBuilder.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/util/ResponseBuilder.java index a0d8c4da57..fb45a18c55 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/util/ResponseBuilder.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/util/ResponseBuilder.java @@ -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 data = new HashMap(); data.put("returnCode", returnCode); + data.put("messageKey", messageKey); data.put("message", message); processData(getTemplate("insert-document.ftlx"), data, xmlText); diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 8e49638816..69f9a1f1e0 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -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") } diff --git a/bigbluebutton-web/src/main/webapp/WEB-INF/freemarker/insert-document.ftlx b/bigbluebutton-web/src/main/webapp/WEB-INF/freemarker/insert-document.ftlx index 340606ce6d..1d7659454c 100644 --- a/bigbluebutton-web/src/main/webapp/WEB-INF/freemarker/insert-document.ftlx +++ b/bigbluebutton-web/src/main/webapp/WEB-INF/freemarker/insert-document.ftlx @@ -3,6 +3,7 @@ <#-- Where code is a 'SUCCESS' or 'FAILED' String --> ${returnCode} + ${messageKey} ${message} \ No newline at end of file