rename note to notes

This commit is contained in:
Felipe Cecagno 2019-03-11 23:56:29 -03:00
parent f1f56bd868
commit 51b9b91dae
7 changed files with 36 additions and 37 deletions

View File

@ -39,13 +39,13 @@ def archive_events(meeting_id, redis_host, redis_port, raw_archive_dir, break_ti
#end #end
end end
def archive_note(meeting_id, note_endpoint, note_formats, raw_archive_dir) def archive_note(meeting_id, notes_endpoint, notes_formats, raw_archive_dir)
BigBlueButton.logger.info("Archiving notes for #{meeting_id}") BigBlueButton.logger.info("Archiving notes for #{meeting_id}")
note_dir = "#{raw_archive_dir}/#{meeting_id}/note" notes_dir = "#{raw_archive_dir}/#{meeting_id}/notes"
FileUtils.mkdir_p(note_dir) FileUtils.mkdir_p(notes_dir)
note_id = FNV.new.fnv1a_32(meeting_id).to_s(16) notes_id = FNV.new.fnv1a_32(meeting_id).to_s(16)
note_formats.each do |format| notes_formats.each do |format|
BigBlueButton.try_download("#{note_endpoint}/#{note_id}/export/#{format}", "#{note_dir}/note.#{format}") BigBlueButton.try_download("#{notes_endpoint}/#{notes_id}/export/#{format}", "#{notes_dir}/notes.#{format}")
end end
end end
@ -136,8 +136,8 @@ video_dir = props['raw_video_src']
kurento_video_dir = props['kurento_video_src'] kurento_video_dir = props['kurento_video_src']
kurento_screenshare_dir = props['kurento_screenshare_src'] kurento_screenshare_dir = props['kurento_screenshare_src']
log_dir = props['log_dir'] log_dir = props['log_dir']
note_endpoint = props['note_endpoint'] notes_endpoint = props['notes_endpoint']
note_formats = props['note_formats'] notes_formats = props['notes_formats']
# Determine the filenames for the done and fail files # Determine the filenames for the done and fail files
if !break_timestamp.nil? if !break_timestamp.nil?
@ -154,7 +154,7 @@ target_dir = "#{raw_archive_dir}/#{meeting_id}"
FileUtils.mkdir_p target_dir FileUtils.mkdir_p target_dir
archive_events(meeting_id, redis_host, redis_port, raw_archive_dir, break_timestamp) archive_events(meeting_id, redis_host, redis_port, raw_archive_dir, break_timestamp)
archive_audio(meeting_id, audio_dir, raw_archive_dir) archive_audio(meeting_id, audio_dir, raw_archive_dir)
archive_note(meeting_id, note_endpoint, note_formats, raw_archive_dir) archive_note(meeting_id, notes_endpoint, notes_formats, raw_archive_dir)
archive_directory("#{presentation_dir}/#{meeting_id}/#{meeting_id}", archive_directory("#{presentation_dir}/#{meeting_id}/#{meeting_id}",
"#{target_dir}/presentation") "#{target_dir}/presentation")
archive_directory("#{screenshare_dir}/#{meeting_id}", archive_directory("#{screenshare_dir}/#{meeting_id}",

View File

@ -7,8 +7,8 @@ raw_screenshare_src: /usr/share/red5/webapps/screenshare/streams
raw_webrtc_deskshare_src: /usr/share/red5/webapps/video-broadcast/streams raw_webrtc_deskshare_src: /usr/share/red5/webapps/video-broadcast/streams
raw_deskshare_src: /var/bigbluebutton/deskshare raw_deskshare_src: /var/bigbluebutton/deskshare
raw_presentation_src: /var/bigbluebutton raw_presentation_src: /var/bigbluebutton
note_endpoint: http://localhost:9001/p notes_endpoint: http://localhost:9001/p
note_formats: notes_formats:
- etherpad - etherpad
- html - html
- txt - txt

View File

@ -1,2 +0,0 @@
publish_dir: /var/bigbluebutton/published/note
format: pdf

View File

@ -16,7 +16,7 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. # with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
# #
location /note { location /notes {
root /var/bigbluebutton/published; root /var/bigbluebutton/published;
index index.html index.htm; index index.html index.htm;
} }

View File

@ -0,0 +1,2 @@
publish_dir: /var/bigbluebutton/published/notes
format: pdf

View File

@ -39,19 +39,19 @@ meeting_id = opts[:meeting_id]
# This script lives in scripts/archive/steps while properties.yaml lives in scripts/ # This script lives in scripts/archive/steps while properties.yaml lives in scripts/
props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml')) props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
note_props = YAML::load(File.open('note.yml')) notes_props = YAML::load(File.open('notes.yml'))
format = note_props['format'] format = notes_props['format']
recording_dir = props['recording_dir'] recording_dir = props['recording_dir']
raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}" raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}"
log_dir = props['log_dir'] log_dir = props['log_dir']
target_dir = "#{recording_dir}/process/note/#{meeting_id}" target_dir = "#{recording_dir}/process/notes/#{meeting_id}"
if not FileTest.directory?(target_dir) if not FileTest.directory?(target_dir)
FileUtils.mkdir_p "#{log_dir}/note" FileUtils.mkdir_p "#{log_dir}/notes"
logger = Logger.new("#{log_dir}/note/process-#{meeting_id}.log", 'daily' ) logger = Logger.new("#{log_dir}/notes/process-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger BigBlueButton.logger = logger
BigBlueButton.logger.info("Processing script note.rb") BigBlueButton.logger.info("Processing script notes.rb")
FileUtils.mkdir_p target_dir FileUtils.mkdir_p target_dir
begin begin
@ -72,7 +72,7 @@ if not FileTest.directory?(target_dir)
metadata_xml.close metadata_xml.close
BigBlueButton.logger.info("Created inital metadata.xml") BigBlueButton.logger.info("Created inital metadata.xml")
FileUtils.cp("#{raw_archive_dir}/note/note.#{format}", "#{target_dir}/note.#{format}") FileUtils.cp("#{raw_archive_dir}/notes/notes.#{format}", "#{target_dir}/notes.#{format}")
# Get the real-time start and end timestamp # Get the real-time start and end timestamp
@doc = Nokogiri::XML(File.open("#{raw_archive_dir}/events.xml")) @doc = Nokogiri::XML(File.open("#{raw_archive_dir}/events.xml"))
@ -84,7 +84,6 @@ if not FileTest.directory?(target_dir)
real_start_time = match[1] real_start_time = match[1]
real_end_time = (real_start_time.to_i + (meeting_end.to_i - meeting_start.to_i)).to_s real_end_time = (real_start_time.to_i + (meeting_end.to_i - meeting_start.to_i)).to_s
# Add start_time, end_time and meta to metadata.xml # Add start_time, end_time and meta to metadata.xml
## Load metadata.xml ## Load metadata.xml
metadata = Nokogiri::XML(File.open("#{target_dir}/metadata.xml")) metadata = Nokogiri::XML(File.open("#{target_dir}/metadata.xml"))
@ -134,7 +133,7 @@ if not FileTest.directory?(target_dir)
metadata_file.close metadata_file.close
BigBlueButton.logger.info("Created an updated metadata.xml with start_time and end_time") BigBlueButton.logger.info("Created an updated metadata.xml with start_time and end_time")
process_done = File.new("#{recording_dir}/status/processed/#{meeting_id}-note.done", "w") process_done = File.new("#{recording_dir}/status/processed/#{meeting_id}-notes.done", "w")
process_done.write("Processed #{meeting_id}") process_done.write("Processed #{meeting_id}")
process_done.close process_done.close

View File

@ -31,7 +31,7 @@ require 'fastimage' # require fastimage to get the image size of the slides (gem
# This script lives in scripts/archive/steps while properties.yaml lives in scripts/ # This script lives in scripts/archive/steps while properties.yaml lives in scripts/
bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml')) bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
note_props = YAML::load(File.open('note.yml')) notes_props = YAML::load(File.open('notes.yml'))
opts = Trollop::options do opts = Trollop::options do
opt :meeting_id, "Meeting id to archive", :default => '58f4a6b3-cd07-444d-8564-59116cb53974', :type => String opt :meeting_id, "Meeting id to archive", :default => '58f4a6b3-cd07-444d-8564-59116cb53974', :type => String
@ -48,28 +48,28 @@ puts playback
begin begin
if (playback == "note") if (playback == "notes")
log_dir = bbb_props['log_dir'] log_dir = bbb_props['log_dir']
logger = Logger.new("#{log_dir}/note/publish-#{meeting_id}.log", 'daily' ) logger = Logger.new("#{log_dir}/notes/publish-#{meeting_id}.log", 'daily' )
BigBlueButton.logger = logger BigBlueButton.logger = logger
recording_dir = bbb_props['recording_dir'] recording_dir = bbb_props['recording_dir']
raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}" raw_archive_dir = "#{recording_dir}/raw/#{meeting_id}"
process_dir = "#{recording_dir}/process/note/#{meeting_id}" process_dir = "#{recording_dir}/process/notes/#{meeting_id}"
publish_dir = note_props['publish_dir'] publish_dir = notes_props['publish_dir']
format = note_props['format'] format = notes_props['format']
playback_protocol = bbb_props['playback_protocol'] playback_protocol = bbb_props['playback_protocol']
playback_host = bbb_props['playback_host'] playback_host = bbb_props['playback_host']
target_dir = "#{recording_dir}/publish/note/#{meeting_id}" target_dir = "#{recording_dir}/publish/notes/#{meeting_id}"
if not FileTest.directory?(target_dir) if not FileTest.directory?(target_dir)
BigBlueButton.logger.info("Making dir target_dir") BigBlueButton.logger.info("Making dir target_dir")
FileUtils.mkdir_p target_dir FileUtils.mkdir_p target_dir
BigBlueButton.logger.info("copying: #{process_dir}/note.#{format} to -> #{target_dir}") BigBlueButton.logger.info("copying: #{process_dir}/notes.#{format} to -> #{target_dir}")
FileUtils.cp("#{process_dir}/note.#{format}", target_dir) FileUtils.cp("#{process_dir}/notes.#{format}", target_dir)
@doc = Nokogiri::XML(File.open("#{raw_archive_dir}/events.xml")) @doc = Nokogiri::XML(File.open("#{raw_archive_dir}/events.xml"))
recording_time = BigBlueButton::Events.get_recording_length(@doc) recording_time = BigBlueButton::Events.get_recording_length(@doc)
@ -97,8 +97,8 @@ begin
## Add the actual playback ## Add the actual playback
metadata_with_playback = Nokogiri::XML::Builder.with(metadata.at('recording')) do |xml| metadata_with_playback = Nokogiri::XML::Builder.with(metadata.at('recording')) do |xml|
xml.playback { xml.playback {
xml.format("note") xml.format("notes")
xml.link("#{playback_protocol}://#{playback_host}/note/#{meeting_id}/note.#{format}") xml.link("#{playback_protocol}://#{playback_host}/notes/#{meeting_id}/notes.#{format}")
xml.duration("#{recording_time}") xml.duration("#{recording_time}")
} }
end end
@ -122,7 +122,7 @@ begin
BigBlueButton.add_playback_size_to_metadata(target_dir) BigBlueButton.add_playback_size_to_metadata(target_dir)
FileUtils.cp_r(target_dir, publish_dir) # Copy all the files. FileUtils.cp_r(target_dir, publish_dir) # Copy all the files.
BigBlueButton.logger.info("Finished publishing script note.rb successfully.") BigBlueButton.logger.info("Finished publishing script notes.rb successfully.")
BigBlueButton.logger.info("Removing processed files.") BigBlueButton.logger.info("Removing processed files.")
FileUtils.rm_r(process_dir) FileUtils.rm_r(process_dir)
@ -130,7 +130,7 @@ begin
BigBlueButton.logger.info("Removing published files.") BigBlueButton.logger.info("Removing published files.")
FileUtils.rm_r(target_dir) FileUtils.rm_r(target_dir)
publish_done = File.new("#{recording_dir}/status/published/#{meeting_id}-note.done", "w") publish_done = File.new("#{recording_dir}/status/published/#{meeting_id}-notes.done", "w")
publish_done.write("Published #{meeting_id}") publish_done.write("Published #{meeting_id}")
publish_done.close publish_done.close
@ -145,7 +145,7 @@ rescue Exception => e
e.backtrace.each do |traceline| e.backtrace.each do |traceline|
BigBlueButton.logger.error(traceline) BigBlueButton.logger.error(traceline)
end end
publish_done = File.new("#{recording_dir}/status/published/#{meeting_id}-note.fail", "w") publish_done = File.new("#{recording_dir}/status/published/#{meeting_id}-notes.fail", "w")
publish_done.write("Failed Publishing #{meeting_id}") publish_done.write("Failed Publishing #{meeting_id}")
publish_done.close publish_done.close