Merge pull request #3654 from alexandrekreis/master
Returning number of users that participated in each meeting
This commit is contained in:
commit
f3b67e5b82
@ -135,6 +135,7 @@ public class RecordingServiceHelperImp implements RecordingServiceHelper {
|
|||||||
r.setPublished(Boolean.parseBoolean(rec.published.text()));
|
r.setPublished(Boolean.parseBoolean(rec.published.text()));
|
||||||
r.setStartTime(rec.start_time.text());
|
r.setStartTime(rec.start_time.text());
|
||||||
r.setEndTime(rec.end_time.text());
|
r.setEndTime(rec.end_time.text());
|
||||||
|
r.setNumParticipants(rec.participants.text());
|
||||||
if ( !rec.playback.text().equals("") ) {
|
if ( !rec.playback.text().equals("") ) {
|
||||||
r.setPlaybackFormat(rec.playback.format.text());
|
r.setPlaybackFormat(rec.playback.format.text());
|
||||||
r.setPlaybackLink(rec.playback.link.text());
|
r.setPlaybackLink(rec.playback.link.text());
|
||||||
|
@ -34,6 +34,7 @@ public class Recording {
|
|||||||
private boolean published;
|
private boolean published;
|
||||||
private String startTime;
|
private String startTime;
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
private String numParticipants;
|
||||||
private Map<String, String> metadata = new TreeMap<String, String>();
|
private Map<String, String> metadata = new TreeMap<String, String>();
|
||||||
private List<Playback> playbacks=new ArrayList<Playback>();
|
private List<Playback> playbacks=new ArrayList<Playback>();
|
||||||
|
|
||||||
@ -93,6 +94,14 @@ public class Recording {
|
|||||||
return endTime;
|
return endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNumParticipants(String numParticipants) {
|
||||||
|
this.numParticipants = numParticipants;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumParticipants() {
|
||||||
|
return numParticipants;
|
||||||
|
}
|
||||||
|
|
||||||
public void setEndTime(String endTime) {
|
public void setEndTime(String endTime) {
|
||||||
this.endTime = convertOldDateFormat(endTime);
|
this.endTime = convertOldDateFormat(endTime);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<state>${r.getState()?string}</state>
|
<state>${r.getState()?string}</state>
|
||||||
<startTime><#if r.getStartTime()?? && r.getStartTime() != "">${r.getStartTime()}</#if></startTime>
|
<startTime><#if r.getStartTime()?? && r.getStartTime() != "">${r.getStartTime()}</#if></startTime>
|
||||||
<endTime><#if r.getEndTime()?? && r.getEndTime() != "">${r.getEndTime()}</#if></endTime>
|
<endTime><#if r.getEndTime()?? && r.getEndTime() != "">${r.getEndTime()}</#if></endTime>
|
||||||
|
<participants><#if r.getNumParticipants()??>${r.getNumParticipants()}</#if></participants>
|
||||||
<#assign m = r.getMetadata()>
|
<#assign m = r.getMetadata()>
|
||||||
<metadata>
|
<metadata>
|
||||||
<#list m?keys as prop>
|
<#list m?keys as prop>
|
||||||
|
@ -26,6 +26,28 @@ require 'nokogiri'
|
|||||||
module BigBlueButton
|
module BigBlueButton
|
||||||
module Events
|
module Events
|
||||||
|
|
||||||
|
# Get the total number of participants
|
||||||
|
def self.get_num_participants(events_xml)
|
||||||
|
BigBlueButton.logger.info("Task: Getting num participants")
|
||||||
|
doc = Nokogiri::XML(File.open(events_xml))
|
||||||
|
participants_ids = []
|
||||||
|
|
||||||
|
doc.xpath("//event[@eventname='ParticipantJoinEvent']").each do |joinEvent|
|
||||||
|
userId = joinEvent.xpath(".//userId").text
|
||||||
|
|
||||||
|
#removing "_N" at the end of userId
|
||||||
|
userId.gsub!(/_\d*/, "")
|
||||||
|
|
||||||
|
if !participants_ids.include? userId
|
||||||
|
BigBlueButton.logger.info("Counting id = #{userId}")
|
||||||
|
participants_ids << userId
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
BigBlueButton.logger.info("get_num_participants = #{participants_ids.length}")
|
||||||
|
participants_ids.length
|
||||||
|
end
|
||||||
|
|
||||||
# Get the meeting metadata
|
# Get the meeting metadata
|
||||||
def self.get_meeting_metadata(events_xml)
|
def self.get_meeting_metadata(events_xml)
|
||||||
BigBlueButton.logger.info("Task: Getting meeting metadata")
|
BigBlueButton.logger.info("Task: Getting meeting metadata")
|
||||||
|
@ -68,6 +68,7 @@ if not FileTest.directory?(target_dir)
|
|||||||
b.published(false)
|
b.published(false)
|
||||||
b.start_time
|
b.start_time
|
||||||
b.end_time
|
b.end_time
|
||||||
|
b.participants
|
||||||
b.playback
|
b.playback
|
||||||
b.meta
|
b.meta
|
||||||
}
|
}
|
||||||
@ -107,6 +108,10 @@ if not FileTest.directory?(target_dir)
|
|||||||
start_time.content = real_start_time
|
start_time.content = real_start_time
|
||||||
end_time = recording.at_xpath("end_time")
|
end_time = recording.at_xpath("end_time")
|
||||||
end_time.content = real_end_time
|
end_time.content = real_end_time
|
||||||
|
|
||||||
|
participants = recording.at_xpath("participants")
|
||||||
|
participants.content = BigBlueButton::Events.get_num_participants("#{target_dir}/events.xml")
|
||||||
|
|
||||||
## Remove empty meta
|
## Remove empty meta
|
||||||
metadata.search('//recording/meta').each do |meta|
|
metadata.search('//recording/meta').each do |meta|
|
||||||
meta.remove
|
meta.remove
|
||||||
|
Loading…
Reference in New Issue
Block a user