Changeset 34406d in indico
- Timestamp:
- 06/10/10 18:11:36 (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, 00b052b1a13a63c5c79db7f3ad310f643651dc50
- Children:
- a11194
- Parents:
- b04aa4
- git-author:
- David Martín Clavo <david.martin.clavo@…> (04/16/10 18:27:52)
- git-committer:
- Jeremy Herr <jeremy.herr@…> (06/10/10 18:11:36)
- Location:
- indico/MaKaC
- Files:
-
- 5 edited
-
common/output.py (modified) (4 diffs)
-
plugins/Collaboration/RecordingManager/common.py (modified) (3 diffs)
-
plugins/Collaboration/RecordingManager/micala.py (modified) (10 diffs)
-
plugins/Collaboration/RecordingManager/output.py (modified) (3 diffs)
-
plugins/Collaboration/RecordingManager/services.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/common/output.py
r26e87f r34406d 268 268 # because we have verified that the RecordingManager plugin is installed. 269 269 from MaKaC.plugins.Collaboration.RecordingManager.output import MarcAccessListGenerator 270 MarcAccessListGenerator ().generateAccessListXML(out, conf)271 MarcAccessListGenerator ().generateVideoXML(out, recordingManagerTags)272 MarcAccessListGenerator ().generateLanguagesXML(out, recordingManagerTags)270 MarcAccessListGenerator.generateAccessListXML(out, conf) 271 MarcAccessListGenerator.generateVideoXML(out, recordingManagerTags) 272 MarcAccessListGenerator.generateLanguagesXML(out, recordingManagerTags) 273 273 274 274 if conf.canModify( self.__aw ) and vars and modificons: … … 563 563 # only now do we know it's safe to import the necessary method 564 564 from MaKaC.plugins.Collaboration.RecordingManager.output import MarcAccessListGenerator 565 MarcAccessListGenerator ().generateAccessListXML(out, session)566 MarcAccessListGenerator ().generateVideoXML(out, recordingManagerTags)567 MarcAccessListGenerator ().generateLanguagesXML(out, recordingManagerTags)565 MarcAccessListGenerator.generateAccessListXML(out, session) 566 MarcAccessListGenerator.generateVideoXML(out, recordingManagerTags) 567 MarcAccessListGenerator.generateLanguagesXML(out, recordingManagerTags) 568 568 569 569 out.closeTag("session") … … 797 797 # only now do we know it's safe to import the necessary method 798 798 from MaKaC.plugins.Collaboration.RecordingManager.output import MarcAccessListGenerator 799 MarcAccessListGenerator ().generateAccessListXML(out, contribution)800 MarcAccessListGenerator ().generateVideoXML(out, recordingManagerTags)801 MarcAccessListGenerator ().generateLanguagesXML(out, recordingManagerTags)799 MarcAccessListGenerator.generateAccessListXML(out, contribution) 800 MarcAccessListGenerator.generateVideoXML(out, recordingManagerTags) 801 MarcAccessListGenerator.generateLanguagesXML(out, recordingManagerTags) 802 802 803 803 out.closeTag("contribution") … … 882 882 # only now do we know it's safe to import the necessary method 883 883 from MaKaC.plugins.Collaboration.RecordingManager.output import MarcAccessListGenerator 884 MarcAccessListGenerator ().generateAccessListXML(out, subCont)885 MarcAccessListGenerator ().generateVideoXML(out, recordingManagerTags)886 MarcAccessListGenerator ().generateLanguagesXML(out, recordingManagerTags)884 MarcAccessListGenerator.generateAccessListXML(out, subCont) 885 MarcAccessListGenerator.generateVideoXML(out, recordingManagerTags) 886 MarcAccessListGenerator.generateLanguagesXML(out, recordingManagerTags) 887 887 888 888 out.closeTag("subcontribution") -
indico/MaKaC/plugins/Collaboration/RecordingManager/common.py
rb04aa4 r34406d 198 198 cds_indico_matches = getCDSRecords(conference.getId()) 199 199 Logger.get('RecMan').info('cds_indico_pending...') 200 cds_indico_pending = MicalaCommunication ().getCDSPending(conference.getId(), cds_indico_matches)200 cds_indico_pending = MicalaCommunication.getCDSPending(conference.getId(), cds_indico_matches) 201 201 202 202 # In case there are any records that were pending and are now appearing in CDS, 203 203 # then update the micala database accordingly. 204 MicalaCommunication ().updateMicalaCDSExport(cds_indico_matches, cds_indico_pending)204 MicalaCommunication.updateMicalaCDSExport(cds_indico_matches, cds_indico_pending) 205 205 206 206 Logger.get('RecMan').info("cds_indico_matches: %s, cds_indico_pending: %s" % (cds_indico_matches, cds_indico_pending)) … … 219 219 220 220 # Get list of matching IndicoID's and LOIDs from the Micala database 221 existing_matches = MicalaCommunication ().getMatches(conference.getId())221 existing_matches = MicalaCommunication.getMatches(conference.getId()) 222 222 223 223 # insert any existing matches into the recordable_events array … … 516 516 517 517 # Update the micala database with our current task status 518 idMachine = MicalaCommunication ().getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName"))519 idTask = MicalaCommunication ().getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS"))520 idLecture = MicalaCommunication ().getIdLecture(IndicoID, pattern_cern, pattern_umich)518 idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) 519 idTask = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS")) 520 idLecture = MicalaCommunication.getIdLecture(IndicoID, pattern_cern, pattern_umich) 521 521 if idLecture == '': 522 idLecture = MicalaCommunication ().createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich)523 MicalaCommunication ().reportStatus('START', '', idMachine, idTask, idLecture)522 idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich) 523 MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture) 524 524 525 525 # temporary, for my own debugging -
indico/MaKaC/plugins/Collaboration/RecordingManager/micala.py
rb04aa4 r34406d 6 6 7 7 class MicalaCommunication(object): 8 def _init_(self): 9 pass 10 11 def getIp(self): 8 9 @classmethod 10 def getIp(cls): 12 11 '''This should return the IP of the current machine.''' 13 12 return("") 14 13 15 def getIdMachine(self, machine_name): 14 @classmethod 15 def getIdMachine(cls, machine_name): 16 16 '''Look up ID of this machine in database''' 17 17 … … 46 46 return(idMachine) 47 47 48 def getIdTask(self, task_name): 48 @classmethod 49 def getIdTask(cls, task_name): 49 50 '''Look up ID of this task in database''' 50 51 … … 77 78 return(idTask) 78 79 79 def getIdLecture(self, lecture_name, pattern_cern, pattern_umich): 80 @classmethod 81 def getIdLecture(cls, lecture_name, pattern_cern, pattern_umich): 80 82 '''Look up ID of this lecture in database''' 81 83 … … 116 118 return(idLecture) 117 119 118 def createNewMicalaLecture(self, lecture_name, contentType, pattern_cern, pattern_umich): 120 @classmethod 121 def createNewMicalaLecture(cls, lecture_name, contentType, pattern_cern, pattern_umich): 119 122 '''insert a record into the micala database for a new lecture''' 120 123 … … 153 156 connection.close() 154 157 155 return self.getIdLecture(lecture_name, pattern_cern, pattern_umich) 156 157 def getMatches(self, confID): 158 return cls.getIdLecture(lecture_name, pattern_cern, pattern_umich) 159 160 @classmethod 161 def getMatches(cls, confID): 158 162 '''For the current conference, get list from the database of IndicoID's already matched to Lecture Object.''' 159 163 … … 180 184 return (match_array) 181 185 182 def reportStatus(self, status, message, idMachine, idTask, idLecture): 186 @classmethod 187 def reportStatus(cls, status, message, idMachine, idTask, idLecture): 183 188 '''Make status report to the database''' 184 189 … … 206 211 207 212 # WHO THE HELL CALLS THIS?! 208 def updateMicala(self, IndicoID, contentType, LOID): 213 @classmethod 214 def updateMicala(cls, IndicoID, contentType, LOID): 209 215 """Submit Indico ID to the micala DB""" 210 216 … … 239 245 pass 240 246 241 def getCDSPending(self, confId, cds_indico_matches): 247 @classmethod 248 def getCDSPending(cls, confId, cds_indico_matches): 242 249 """Query the Micala database to find Indico IDs whose MARC has been exported to CDS, but no CDS record exists yet. 243 250 Return a list of these Indico IDs.""" … … 280 287 return talk_array 281 288 282 def updateMicalaCDSExport(self, cds_indico_matches, cds_indico_pending): 289 @classmethod 290 def updateMicalaCDSExport(cls, cds_indico_matches, cds_indico_pending): 283 291 '''If there are records found in CDS but not yet listed in the micala database as COMPLETE, then update it. 284 292 cds_indico_matches is a dictionary of key-value pairs { IndicoID1: CDSID1, IndicoID2: CDSID2, ... } … … 289 297 try: 290 298 new_record = cds_indico_matches[pending] 291 idMachine = self.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName"))292 idTask = self.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS"))299 idMachine = cls.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) 300 idTask = cls.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS")) 293 301 import re 294 302 pattern_cern = re.compile('([sc\d]+)$') 295 303 pattern_umich = re.compile('(\d+\-[\w\d]+\-\d)$') 296 idLecture = self.getIdLecture(pending, pattern_cern, pattern_umich)297 self.reportStatus("COMPLETE", "CDS record: %s" % new_record, idMachine, idTask, idLecture)304 idLecture = cls.getIdLecture(pending, pattern_cern, pattern_umich) 305 cls.reportStatus("COMPLETE", "CDS record: %s" % new_record, idMachine, idTask, idLecture) 298 306 299 307 # I should still update the Lectures table to add the CDS record -
indico/MaKaC/plugins/Collaboration/RecordingManager/output.py
rb04aa4 r34406d 6 6 7 7 class MarcAccessListGenerator(object): 8 def __init__(self):9 pass10 8 11 def generateAccessListXML(self, out, obj): 9 @classmethod 10 def generateAccessListXML(cls, out, obj): 12 11 """Generate a comprehensive access list showing all users and e-groups who may access 13 12 this object, taking into account the permissions and access lists of its owners. … … 41 40 out.closeTag("allowedAccessEmails") 42 41 43 def generateVideoXML(self, out, recordingManagerTags): 42 @classmethod 43 def generateVideoXML(cls, out, recordingManagerTags): 44 44 """Generate XML variables needed for video records.""" 45 45 … … 62 62 out.writeTag("videoFormat", contentTypeWebLecture) 63 63 64 def generateLanguagesXML(self, out, recordingManagerTags): 64 @classmethod 65 def generateLanguagesXML(cls, out, recordingManagerTags): 65 66 """Generate XML variables needed for language information.""" 66 67 -
indico/MaKaC/plugins/Collaboration/RecordingManager/services.py
rb04aa4 r34406d 39 39 def _getAnswer(self): 40 40 # here is where we make a submission to the database? 41 MicalaCommunication ().updateMicala(self._params.get('IndicoID', None), self._params.get('LOID', None))41 MicalaCommunication.updateMicala(self._params.get('IndicoID', None), self._params.get('LOID', None)) 42 42 return {'some':'thing'} 43 43 … … 73 73 def _getAnswer(self): 74 74 # Update the micala database 75 resultUpdateMicala = MicalaCommunication ().updateMicala(self._IndicoID,75 resultUpdateMicala = MicalaCommunication.updateMicala(self._IndicoID, 76 76 self._contentType, 77 77 self._params.get('LOID', None))
Note: See TracChangeset
for help on using the changeset viewer.
