Changeset 3e6afb in indico


Ignore:
Timestamp:
06/10/10 18:11:33 (3 years ago)
Author:
Jeremy Herr <jeremy.herr@…>
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)
Message:

[IMP] plain_video vs web_lecture MARC XML working

A lot of small fixes to get the two different modes working...

  • moved JavaScript? var initialization to end of NewBookingForm?.tpl to make sure they get loaded first
  • services.py checks for different vars depending on which mode we're in (plain_video or web_lecture)
  • replaced a hard-coded / file separator with os.path.join()
  • other misc changes

Also, set the height of both panes to be the same height, so all the buttons etc are always within the window all the time.

Location:
indico/MaKaC/plugins/Collaboration/RecordingManager
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/plugins/Collaboration/RecordingManager/Style.css

    r209930 r3e6afb  
    2424    margin-top: 10px; 
    2525    margin-bottom: 10px; 
    26     min-height: 300px; 
    27     max-height: 450px; 
     26    height: 450px; 
    2827    overflow: auto; 
    2928} 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/common.py

    r366d22 r3e6afb  
    348348    return (rows) 
    349349 
    350 def updateMicala(IndicoID, LOID): 
     350def updateMicala(IndicoID, contentType, LOID): 
    351351    """Submit Indico ID to the micala DB""" 
    352352 
    353353#    Logger.get('RecMan').exception("inside updateMicala.") 
    354354 
    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 
     383def createCDSRecord(aw, IndicoID, contentType, videoFormat): 
    377384    '''Retrieve a MARC XML string for the given conference, then package it up and send it to CDS.''' 
    378385 
     
    380387    xmlGen = XMLGen() 
    381388    xmlGen.initXml() 
    382     di = DataInt(xmlGen) 
    383 #    og = outputGenerator(aw, dataInt=di) 
     389 
    384390    og = outputGenerator(aw, xmlGen) 
    385391 
     
    426432 
    427433    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): 
    431444        try: 
    432             Logger.get('RecMan').info("Trying to do XSLT using path %s" % stylepath) 
    433             parser = XSLTransformer(stylepath) 
     445            Logger.get('RecMan').info("Trying to do XSLT using path %s" % stylePath) 
     446            parser = XSLTransformer(stylePath) 
    434447            outputData = parser.process(marcxml) 
    435448        except: 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/output.py

    r366d22 r3e6afb  
    22from MaKaC.user import Avatar 
    33from MaKaC.user import CERNGroup 
     4 
     5from MaKaC.common.logger import Logger 
    46 
    57class MarcAccessListGenerator(): 
     
    8284        """Generate XML variables needed for video records.""" 
    8385 
     86        Logger.get('RecMan').info("videoFormat = %s" % videoFormat) 
     87 
    8488        videoTagStandard = CollaborationTools.getOptionValue("RecordingManager", "videoFormatStandard") 
    8589        videoTagWide     = CollaborationTools.getOptionValue("RecordingManager", "videoFormatWide") 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/services.py

    r366d22 r3e6afb  
    5151        self._confId      = self._params.get('conference', None) 
    5252        self._videoFormat = self._params.get('videoFormat', None) 
     53        self._contentType = self._params.get('contentType', None) 
    5354 
     55        if not self._contentType: 
     56            raise RecordingManagerException("No content type supplied (plain video or web lecture)") 
    5457        if not self._IndicoID: 
    5558            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 
    5867        if not self._confId: 
    5968            raise RecordingManagerException("No conference ID supplied") 
    60         if not self._videoFormat: 
    61             raise RecordingManagerException("No video format supplied") 
    6269 
    6370    def _getAnswer(self): 
    6471        # 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)) 
    6675 
    6776        # 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) 
    6981 
    7082#        raise RecordingManagerException("got this far") 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/Extra.js

    rb3195a r3e6afb  
    234234 
    235235// jherr stuff 
    236 var RMselectedTalkId   = ''; 
    237 var RMselectedLOID     = ''; 
    238 var RMselectedTalkName = ''; 
    239 var RMselectedLOName   = ''; 
    240 var RMviewMode         = ''; 
    241 var RMvideoFormat      = 'standard'; 
    242236 
    243237function RMbuttonModeSelect(mode) { 
     
    412406                IndicoID: RMselectedTalkId, 
    413407                LOID: RMselectedLOID, 
    414                 videoFormat: RMvideoFormat 
     408                videoFormat: RMvideoFormat, 
     409                contentType: RMviewMode 
    415410            }, 
    416411        function(result, error){ 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/NewBookingForm.tpl

    rb3195a r3e6afb  
    138138    var RM_orphans = <%= jsonEncode(Orphans) %>; 
    139139 
     140    var RMselectedTalkId   = ''; 
     141    var RMselectedLOID     = ''; 
     142    var RMselectedTalkName = ''; 
     143    var RMselectedLOName   = ''; 
     144    var RMviewMode         = ''; 
     145    var RMvideoFormat      = 'standard'; 
     146 
    140147    // Draw the two buttons, which start out as disabled until 
    141148    // the user has selected both talk and LO 
Note: See TracChangeset for help on using the changeset viewer.