Changeset 3e6afb in indico
- Timestamp:
- 06/10/10 18:11:33 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- 57e653
- Parents:
- b3195a
- git-author:
- Jeremy Herr <jeremy.herr@…> (03/25/10 18:05:39)
- git-committer:
- Jeremy Herr <jeremy.herr@…> (06/10/10 18:11:33)
- Location:
- indico/MaKaC/plugins/Collaboration/RecordingManager
- Files:
-
- 6 edited
-
Style.css (modified) (1 diff)
-
common.py (modified) (3 diffs)
-
output.py (modified) (2 diffs)
-
services.py (modified) (1 diff)
-
tpls/Extra.js (modified) (2 diffs)
-
tpls/NewBookingForm.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/plugins/Collaboration/RecordingManager/Style.css
r209930 r3e6afb 24 24 margin-top: 10px; 25 25 margin-bottom: 10px; 26 min-height: 300px; 27 max-height: 450px; 26 height: 450px; 28 27 overflow: auto; 29 28 } -
indico/MaKaC/plugins/Collaboration/RecordingManager/common.py
r366d22 r3e6afb 348 348 return (rows) 349 349 350 def updateMicala(IndicoID, LOID):350 def updateMicala(IndicoID, contentType, LOID): 351 351 """Submit Indico ID to the micala DB""" 352 352 353 353 # Logger.get('RecMan').exception("inside updateMicala.") 354 354 355 try: 356 connection = MySQLdb.connect(host = CollaborationTools.getOptionValue("RecordingManager", "micalaDBServer"), 357 port = int(CollaborationTools.getOptionValue("RecordingManager", "micalaDBPort")), 358 user = CollaborationTools.getOptionValue("RecordingManager", "micalaDBUser"), 359 passwd = CollaborationTools.getOptionValue("RecordingManager", "micalaDBPW"), 360 db = CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) 361 except MySQLdb.Error, e: 362 raise RecordingManagerException("MySQL database error %d: %s" % (e.args[0], e.args[1])) 363 364 cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) 365 366 try: 367 cursor.execute("UPDATE Lectures SET IndicoID=%s WHERE id=%s", 368 (IndicoID, LOID)) 369 connection.commit() 370 except MySQLdb.Error, e: 371 raise RecordingManagerException("MySQL database error %d: %s" % (e.args[0], e.args[1])) 372 373 cursor.close() 374 connection.close() 375 376 def createCDSRecord(IndicoID, aw, videoFormat): 355 if contentType == 'web_lecture': 356 try: 357 connection = MySQLdb.connect(host = CollaborationTools.getOptionValue("RecordingManager", "micalaDBServer"), 358 port = int(CollaborationTools.getOptionValue("RecordingManager", "micalaDBPort")), 359 user = CollaborationTools.getOptionValue("RecordingManager", "micalaDBUser"), 360 passwd = CollaborationTools.getOptionValue("RecordingManager", "micalaDBPW"), 361 db = CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) 362 except MySQLdb.Error, e: 363 raise RecordingManagerException("MySQL database error %d: %s" % (e.args[0], e.args[1])) 364 365 cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) 366 367 try: 368 cursor.execute("UPDATE Lectures SET IndicoID=%s WHERE id=%s", 369 (IndicoID, LOID)) 370 connection.commit() 371 except MySQLdb.Error, e: 372 raise RecordingManagerException("MySQL database error %d: %s" % (e.args[0], e.args[1])) 373 374 cursor.close() 375 connection.close() 376 377 elif contentType == 'plain_video': 378 # Should update the database here as well. 379 # first need to backup the DB, create a new column called contentType 380 # (I already created this column in micala.sql, just need to recreate DB from this file) 381 pass 382 383 def createCDSRecord(aw, IndicoID, contentType, videoFormat): 377 384 '''Retrieve a MARC XML string for the given conference, then package it up and send it to CDS.''' 378 385 … … 380 387 xmlGen = XMLGen() 381 388 xmlGen.initXml() 382 di = DataInt(xmlGen) 383 # og = outputGenerator(aw, dataInt=di) 389 384 390 og = outputGenerator(aw, xmlGen) 385 391 … … 426 432 427 433 outputData = "" 428 stylepath = "%s/%s.xsl" % (Config.getInstance().getStylesheetsDir(), 429 'cds_marcxml_presentation') 430 if os.path.exists(stylepath): 434 stylePath = "" 435 436 if parsed["type"] == 'contribution': 437 stylePath = "%s.xsl" % (os.path.join(Config.getInstance().getStylesheetsDir(), 438 'cds_marcxml_video_contribution')) 439 else: 440 stylePath = "%s.xsl" % (os.path.join(Config.getInstance().getStylesheetsDir(), 441 'cds_marcxml_video_presentation')) 442 443 if os.path.exists(stylePath): 431 444 try: 432 Logger.get('RecMan').info("Trying to do XSLT using path %s" % style path)433 parser = XSLTransformer(style path)445 Logger.get('RecMan').info("Trying to do XSLT using path %s" % stylePath) 446 parser = XSLTransformer(stylePath) 434 447 outputData = parser.process(marcxml) 435 448 except: -
indico/MaKaC/plugins/Collaboration/RecordingManager/output.py
r366d22 r3e6afb 2 2 from MaKaC.user import Avatar 3 3 from MaKaC.user import CERNGroup 4 5 from MaKaC.common.logger import Logger 4 6 5 7 class MarcAccessListGenerator(): … … 82 84 """Generate XML variables needed for video records.""" 83 85 86 Logger.get('RecMan').info("videoFormat = %s" % videoFormat) 87 84 88 videoTagStandard = CollaborationTools.getOptionValue("RecordingManager", "videoFormatStandard") 85 89 videoTagWide = CollaborationTools.getOptionValue("RecordingManager", "videoFormatWide") -
indico/MaKaC/plugins/Collaboration/RecordingManager/services.py
r366d22 r3e6afb 51 51 self._confId = self._params.get('conference', None) 52 52 self._videoFormat = self._params.get('videoFormat', None) 53 self._contentType = self._params.get('contentType', None) 53 54 55 if not self._contentType: 56 raise RecordingManagerException("No content type supplied (plain video or web lecture)") 54 57 if not self._IndicoID: 55 58 raise RecordingManagerException("No IndicoID supplied") 56 if not self._LOID: 57 raise RecordingManagerException("No LOID supplied") 59 60 if self._contentType == 'web_lecture': 61 if not self._LOID: 62 raise RecordingManagerException("No LOID supplied") 63 elif self._contentType == 'plain_video': 64 if not self._videoFormat: 65 raise RecordingManagerException("No video format supplied") 66 58 67 if not self._confId: 59 68 raise RecordingManagerException("No conference ID supplied") 60 if not self._videoFormat:61 raise RecordingManagerException("No video format supplied")62 69 63 70 def _getAnswer(self): 64 71 # Update the micala database 65 resultUpdateMicala = updateMicala(self._IndicoID, self._params.get('LOID', None)) 72 resultUpdateMicala = updateMicala(self._IndicoID, 73 self._contentType, 74 self._params.get('LOID', None)) 66 75 67 76 # Get the MARC XML and submit it to CDS 68 resultCreateCDSRecord = createCDSRecord(self._IndicoID, self._aw, self._videoFormat) 77 resultCreateCDSRecord = createCDSRecord(self._aw, 78 self._IndicoID, 79 self._contentType, 80 self._videoFormat) 69 81 70 82 # raise RecordingManagerException("got this far") -
indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/Extra.js
rb3195a r3e6afb 234 234 235 235 // jherr stuff 236 var RMselectedTalkId = '';237 var RMselectedLOID = '';238 var RMselectedTalkName = '';239 var RMselectedLOName = '';240 var RMviewMode = '';241 var RMvideoFormat = 'standard';242 236 243 237 function RMbuttonModeSelect(mode) { … … 412 406 IndicoID: RMselectedTalkId, 413 407 LOID: RMselectedLOID, 414 videoFormat: RMvideoFormat 408 videoFormat: RMvideoFormat, 409 contentType: RMviewMode 415 410 }, 416 411 function(result, error){ -
indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/NewBookingForm.tpl
rb3195a r3e6afb 138 138 var RM_orphans = <%= jsonEncode(Orphans) %>; 139 139 140 var RMselectedTalkId = ''; 141 var RMselectedLOID = ''; 142 var RMselectedTalkName = ''; 143 var RMselectedLOName = ''; 144 var RMviewMode = ''; 145 var RMvideoFormat = 'standard'; 146 140 147 // Draw the two buttons, which start out as disabled until 141 148 // the user has selected both talk and LO
Note: See TracChangeset
for help on using the changeset viewer.
