Skip to content

Commit

Permalink
Merge pull request #20213 from paultrudel/insertDocument-response-fix
Browse files Browse the repository at this point in the history
refactor(bbb-web): Add message key to insertDocument responses
  • Loading branch information
antobinary committed May 13, 2024
2 parents 376037c + aebb693 commit 5bc104f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ public String buildGetRecordingsResponse(List<RecordingMetadata> recordings, Str
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand All @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<response>
<#-- Where code is a 'SUCCESS' or 'FAILED' String -->
<returncode>${returnCode}</returncode>
<messageKey>${messageKey}</messageKey>
<message>${message}</message>
</response>
</#compress>

0 comments on commit 5bc104f

Please sign in to comment.