def submitMicalaMetadata(aw, IndicoID, contentType, LODBID, LOID, videoFormat, languages): '''Generate a lecture.xml file for the given event, then web upload it to the micala server.''' # Logger.get('RecMan').debug('in submitMicalaMetadata()') # Initialize success flag, and result string to which we will append any errors. flagSuccess = True result = "" # First update the micala database that we've started this task try: idMachine = MicalaCommunication.getIdMachine( CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) idTask = MicalaCommunication.getIdTask( CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportMicala")) idLecture = LODBID # Logger.get('RecMan').debug('submitMicalaMetadata calling reportStatus...') MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture) except Exception, e: flagSuccess = False result += _( "Unknown error occured when updating MICALA START task information in micala database: %s\n." ) % e
def submitMicalaMetadata(aw, IndicoID, contentType, LODBID, LOID, videoFormat, languages): '''Generate a lecture.xml file for the given event, then web upload it to the micala server.''' # Logger.get('RecMan').debug('in submitMicalaMetadata()') # Initialize success flag, and result string to which we will append any errors. flagSuccess = True result = "" # First update the micala database that we've started this task try: idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) idTask = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportMicala")) idLecture = LODBID # Logger.get('RecMan').debug('submitMicalaMetadata calling reportStatus...') MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture) except Exception, e: flagSuccess = False result += _("Unknown error occured when updating MICALA START task information in micala database: %s\n.") % e
flagSuccess = True result = "" try: connection = MySQLdb.connect(host = CollaborationTools.getOptionValue("RecordingManager", "micalaDBServer"), port = int(CollaborationTools.getOptionValue("RecordingManager", "micalaDBPort")), user = CollaborationTools.getOptionValue("RecordingManager", "micalaDBReaderUser"), passwd = CollaborationTools.getOptionValue("RecordingManager", "micalaDBReaderPW"), db = CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) except NameError: raise MaKaCError("You need to install MySQLdb (python-mysql) in order to use the Recording Manager") except MySQLdb.Error, e: flagSuccess = False result += "MySQL error %d: %s" % (e.args[0], e.args[1]) idTaskRecording = MicalaCommunication.getIdTask("recording") if flagSuccess == True: try: cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) # Query Lectures table for all records in which IndicoID is blank or NULL cursor.execute("""SELECT L.idLecture AS idLecture, L.LOID AS LOID, L.IndicoID AS IndicoID, M.Hostname AS Hostname, V.RoomName AS RoomName, L.Duration AS Duration FROM Lectures L, LectureLatestStatus LS, Status S, Machines M, Venues V WHERE LS.idLecture = L.idLecture AND LS.idTask = %s AND LS.idStatus = S.idStatus AND S.idMachine = M.idMachine AND M.idVenue = V.idVenue AND (NOT L.IndicoID OR L.IndicoID IS NULL) ORDER BY L.LOID""", (idTaskRecording,))
"micalaDBPort")), user=CollaborationTools.getOptionValue("RecordingManager", "micalaDBReaderUser"), passwd=CollaborationTools.getOptionValue("RecordingManager", "micalaDBReaderPW"), db=CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) except NameError: raise MaKaCError( "You need to install MySQLdb (python-mysql) in order to use the Recording Manager" ) except MySQLdb.Error, e: flagSuccess = False result += "MySQL error %d: %s" % (e.args[0], e.args[1]) idTaskRecording = MicalaCommunication.getIdTask("recording") if flagSuccess == True: try: cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) # Query Lectures table for all records in which IndicoID is blank or NULL cursor.execute( """SELECT L.idLecture AS idLecture, L.LOID AS LOID, L.IndicoID AS IndicoID, M.Hostname AS Hostname, V.RoomName AS RoomName, L.Duration AS Duration FROM Lectures L, LectureLatestStatus LS, Status S, Machines M, Venues V WHERE LS.idLecture = L.idLecture AND LS.idTask = %s AND LS.idStatus = S.idStatus AND S.idMachine = M.idMachine AND M.idVenue = V.idVenue AND L.IndicoID IS NULL ORDER BY L.LOID""", (idTaskRecording, ))