Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SetPollsXML #15762

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public enum ApiCall {
GET_MEETING_INFO("getMeetingInfo", RequestType.GET),
GET_MEETINGS("getMeetings", RequestType.GET),
GET_SESSIONS("getSessions", RequestType.GET),
SET_POLL_XML("setPollXML", RequestType.POST),
GUEST_WAIT("guestWait", RequestType.GET),
ENTER("enter", RequestType.GET),
STUNS("stuns", RequestType.GET),
Expand Down Expand Up @@ -116,9 +115,6 @@ private Request initializeRequest(ApiCall apiCall, Map<String, String[]> params,
case GET_MEETING_INFO:
request = new MeetingInfo(checksum);
break;
case SET_POLL_XML:
request = new SetPollXML(checksum);
break;
case GET_MEETINGS:
case GET_SESSIONS:
request = new SimpleRequest(checksum);
Expand All @@ -142,12 +138,6 @@ private Request initializeRequest(ApiCall apiCall, Map<String, String[]> params,
request = new LearningDashboard();
break;
}
case POST:
checksum = new PostChecksum(apiCall.getName(), checksumValue, params);
switch(apiCall) {
case SET_POLL_XML:
request = new SetPollXML(checksum);
}
}

return request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ class UrlMappings {
action = [GET: 'downloadFile']
}


"/bigbluebutton/api/setPollXML"(controller: "api") {
action = [POST: 'setPollXML']
}

"/bigbluebutton/api/getMeetings"(controller: "api") {
action = [GET: 'getMeetingsHandler', POST: 'getMeetingsHandler']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,65 +682,6 @@ class ApiController {
return reqParams;
}

/***********************************************
* POLL API
***********************************************/
def setPollXML = {
String API_CALL = "setPollXML"
log.debug CONTROLLER_NAME + "#${API_CALL}"

Map<String, String[]> reqParams = getParameters(request)

Map.Entry<String, String> validationResponse = validateRequest(
ValidationService.ApiCall.SET_POLL_XML,
reqParams,
request.getQueryString()
)

if(!(validationResponse == null)) {
invalid(validationResponse.getKey(), validationResponse.getValue())
return
}


Meeting meeting = ServiceUtils.findMeetingFromMeetingID(params.meetingID);

String pollXML = params.pollXML

String decodedPollXML;

try {
decodedPollXML = URLDecoder.decode(pollXML, "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error "Couldn't decode poll XML.", e
invalid("pollXMLError", "Cannot decode poll XML")
return;
}
def pollxml = new XmlSlurper().parseText(decodedPollXML);

pollxml.children().each { poll ->
String title = poll.title.text();
String question = poll.question.text();
String questionType = poll.questionType.text();

ArrayList<String> answers = new ArrayList<String>();
poll.answers.children().each { answer ->
answers.add(answer.text());
}

//send poll to BigBlueButton Apps
meetingService.createdPolls(meeting.getInternalId(), title, question, questionType, answers);
}

response.addHeader("Cache-Control", "no-cache")
withFormat {
xml {
// No need to use the response builder here until we have a more complex response
render(text: "<response><returncode>$RESP_CODE_SUCCESS</returncode></response>", contentType: "text/xml")
}
}
}

/**********************************************
* GUEST WAIT API
*********************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,55 +342,6 @@
}
},
"response": []
},
{
"name": "setPollXML",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonResponse = xml2Json(pm.response.text());",
"",
"console.log(jsonResponse)",
"",
"pm.test(\"Return code is SUCCESS\", function () {",
" pm.expect(jsonResponse.response.returncode).to.eql(\"FAILED\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{base_url}}/{{path}}/setPollXML?meetingID=Demo Meeting&pollXML=<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>&checksum=0cc4142338cc45d4f6eacfbcfa2ea9754061e7eb",
"host": [
"{{base_url}}"
],
"path": [
"{{path}}",
"setPollXML"
],
"query": [
{
"key": "meetingID",
"value": "Demo Meeting"
},
{
"key": "pollXML",
"value": "<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>"
},
{
"key": "checksum",
"value": "0cc4142338cc45d4f6eacfbcfa2ea9754061e7eb"
}
]
}
},
"response": []
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -349,56 +349,6 @@
}
},
"response": []
},
{
"name": "setPollXML",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonResponse = xml2Json(pm.response.text());",
"",
"console.log(jsonResponse)",
"",
"pm.test(\"Return code is SUCCESS\", function () {",
" pm.expect(jsonResponse.response.returncode).to.eql(\"FAILED\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{base_url}}/{{path}}/setPollXML?meetingID=Demo Meeting&pollXML=<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>",
"host": [
"{{base_url}}"
],
"path": [
"{{path}}",
"setPollXML"
],
"query": [
{
"key": "meetingID",
"value": "Demo Meeting"
},
{
"key": "pollXML",
"value": "<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>"
},
{
"key": "checksum",
"value": "0cc4142338cc45d4f6eacfbcfa2ea9754061e7ea",
"disabled": true
}
]
}
},
"response": []
}
]
}
32 changes: 0 additions & 32 deletions bigbluebutton-web/test/postman/valid.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,38 +415,6 @@
},
"response": []
},
{
"name": "setPollXML",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{base_url}}/{{path}}/setPollXML?meetingID=Demo Meeting&pollXML=<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>&checksum=0cc4142338cc45d4f6eacfbcfa2ea9754061e7ea",
"host": [
"{{base_url}}"
],
"path": [
"{{path}}",
"setPollXML"
],
"query": [
{
"key": "meetingID",
"value": "Demo Meeting"
},
{
"key": "pollXML",
"value": "<poll><title>Test Poll</title><question>Test Question</question><questionType>Test</questionType><answers><answer>Answer1</answer><answer>Answer2</answer></answers></poll>"
},
{
"key": "checksum",
"value": "0cc4142338cc45d4f6eacfbcfa2ea9754061e7ea"
}
]
}
},
"response": []
},
{
"name": "guestWait",
"event": [
Expand Down