Changeset 65953b in indico


Ignore:
Timestamp:
06/10/10 18:11:38 (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:
ebef78
Parents:
8b01a9
git-author:
Jeremy Herr <jeremy.herr@…> (05/21/10 11:49:58)
git-committer:
Jeremy Herr <jeremy.herr@…> (06/10/10 18:11:38)
Message:

[IMP] improving performance, several bugfixes

  • in getOrphans(), changed MySQL query to include lecture objects with IndicoID values both "" and NULL, and sort the results in order of LOID
  • added LODBID arg to createCDSRecord() to save one database query looking up LODBID (we already know it, shouldn't need to query all over again).
  • in createCDSRecord(), changed it to only create a new micala DB record for plain_video talks. For web_lecture talks, we already have a record, and we'll wait until later to match the IndicoID with LOID
  • added LODBID arg to submitMicalaMetadata() to save one database query looking up LODBID
  • Deleted pattern_cern and pattern_umich stuff from submitMicalaMetadata(). We should already know what kind of lecture ID we are dealing with, no need to test it again.
  • in submitMicalaMetadata(), added error reporting to micala DB if anything fails.
  • got rid of pattern_cern, pattern_umich stuff from MicalaCommunication?.getIdLecture()
  • changed name of updateMicala() to associateIndicoIDToLOID, much more meaningful
  • Instead of testing whether talk is a web_lecture inside of associateIndicoIDToLOID, test for this in services.py before calling it.
  • added comments to services.py to make it clearer what is happening to plain_video as opposed to web_lecture talks.
  • changed the order in which things happen in services.py. Now associateIndicoIDToLOID() is called before submitMicalaMetadata()
  • deleted the RMLinkService class from services.py. It was left over from stuff David had put in at the beginning, never gets used.
  • deleted RMLink() from Extra.js, it never gets called.
  • XSL stylesheets: Test for existence of speakers. If none, put an <AUTHOR> tag with "no speaker given". Removed <SLIDE> tag with DUMMY value that was there for testing.
Location:
indico/MaKaC
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/plugins/Collaboration/RecordingManager/common.py

    r8b01a9 r65953b  
    363363        try: 
    364364            cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) 
    365             cursor.execute("SELECT id, LOID, IndicoID, Title, Creator FROM Lectures WHERE NOT IndicoID") 
     365            cursor.execute("SELECT id, LOID, IndicoID, Title, Creator FROM Lectures WHERE NOT IndicoID OR IndicoID IS NULL ORDER BY LOID") 
    366366            connection.commit() 
    367367            rows = cursor.fetchall() 
     
    547547    return xmlGen.getXml() 
    548548 
    549 def createCDSRecord(aw, IndicoID, contentType, videoFormat, languages): 
     549def createCDSRecord(aw, IndicoID, LODBID, contentType, videoFormat, languages): 
    550550    '''Retrieve a MARC XML string for the given conference, then web upload it to CDS.''' 
    551551 
     
    641641        # Update the micala database with our current task status 
    642642        try: 
     643            # first need to get DB ids for stuff 
    643644            idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) 
    644645            idTask    = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS")) 
    645             idLecture = MicalaCommunication.getIdLecture(IndicoID, pattern_cern, pattern_umich) 
    646             if idLecture == '': 
    647                 idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich) 
     646            # Look for the current talk in the Lectures table of the micala database 
     647            # If it is a plain_video talk, look for its IndicoID; 
     648            # if it is a web_lecture talk, use its LODBID 
     649            if contentType == 'plain_video': 
     650                idLecture = MicalaCommunication.getIdLecture(IndicoID, pattern_cern, pattern_umich) 
     651                # If the current talk was not found in the micala DB, add a new record. 
     652                if idLecture == '': 
     653                    idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich) 
     654            elif contentType == 'web_lecture': 
     655                # there's no question that there is a record for this lecture object, 
     656                # because we just read the database to get the LODBID. 
     657                idLecture = LODBID 
     658 
    648659            MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture) 
    649660        except Exception, e: 
     
    653664    return {"success": flagSuccess, "result": result} 
    654665 
    655 def submitMicalaMetadata(aw, IndicoID, contentType, LOID, videoFormat, languages): 
     666def submitMicalaMetadata(aw, IndicoID, contentType, LODBID, LOID, videoFormat, languages): 
    656667    '''Generate a lecture.xml file for the given event, then web upload it to the micala server.''' 
    657668 
     
    662673    result = "" 
    663674 
    664     # First, update the micala Tasks table that the submission has started 
    665  
    666     # pattern to match for the signal file 
    667     # Here we are looking for 
    668     # CONFID 
    669     # or CONFIDcCONTRID 
    670     # or CONFIDcCONTRIDscSCONTRID 
    671     # or CONFIDsSESSID 
    672     pattern_cern  = re.compile('([sc\d]+)$') 
    673     # Here we are looking for YYYYMMDD-DEVICENAME-HHMMSS 
    674     pattern_umich = re.compile('(\d+\-[\w\d]+\-\d)$') 
    675  
    676     # Update the micala database with our current task status 
     675    # First update the micala database that we've started this task 
    677676    try: 
    678         Logger.get('RecMan').debug('calling getIdMachine...') 
    679677        idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) 
    680         Logger.get('RecMan').debug('calling getIdTask...') 
    681678        idTask    = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportMicala")) 
    682         Logger.get('RecMan').debug('calling getIdLecture...') 
    683         idLecture = MicalaCommunication.getIdLecture(IndicoID, pattern_cern, pattern_umich) 
    684         Logger.get('RecMan').debug('calling reportStatus...') 
    685         if idLecture == '': 
    686             idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich) 
     679        idLecture = LODBID 
     680        Logger.get('RecMan').debug('submitMicalaMetadata calling reportStatus...') 
    687681        MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture) 
    688682    except Exception, e: 
     
    699693    parsed = parseIndicoID(IndicoID) 
    700694 
    701     # Choose the appropriate stylesheet: 
     695    # Choose the appropriate stylesheet for the type of talk: 
    702696    # - micala_lecture_conference.xsl 
    703697    # - micala_lecture_session.xsl 
     
    755749    # the submission actually succeeded. 
    756750    if flagSuccess == True: 
    757         # pattern to match for the signal file 
    758         # Here we are looking for 
    759         # CONFID 
    760         # or CONFIDcCONTRID 
    761         # or CONFIDcCONTRIDscSCONTRID 
    762         # or CONFIDsSESSID 
    763         pattern_cern  = re.compile('([sc\d]+)$') 
    764         # Here we are looking for YYYYMMDD-DEVICENAME-HHMMSS 
    765         pattern_umich = re.compile('(\d+\-[\w\d]+\-\d)$') 
    766  
    767         # Update the micala database with our current task status 
    768751        try: 
    769             if idLecture == '': 
    770                 idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType, pattern_cern, pattern_umich) 
    771752            MicalaCommunication.reportStatus('COMPLETE', '', idMachine, idTask, idLecture) 
     753        except Exception, e: 
     754            flagSuccess = False 
     755            result += _("Unknown error occured when updating COMPLETE MICALA task information in micala database: %s\n." % e) 
     756    # if errors were encountered, report ERROR status and details to micala DB 
     757    else: 
     758        try: 
     759            MicalaCommunication.reportStatus('ERROR', result, idMachine, idTask, idLecture) 
    772760        except Exception, e: 
    773761            flagSuccess = False 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/micala.py

    r2349da r65953b  
    7979 
    8080    @classmethod 
    81     def getIdLecture(cls, lecture_name, pattern_cern, pattern_umich): 
    82         '''Look up ID of this lecture in database''' 
     81    def getIdLecture(cls, lecture_name): 
     82        '''Look up internal database ID of the given lecture''' 
    8383 
    8484        Logger.get('RecMan').debug('lecture_name = [%s]' % lecture_name) 
    85  
    86         match_cern  = pattern_cern.search(lecture_name) 
    87         match_umich = pattern_umich.search(lecture_name) 
    8885 
    8986        try: 
     
    105102        result_set = cursor.fetchone() 
    106103 
    107         if result_set is not None and len(result_set) > 0 and match_cern: 
     104        if result_set is not None and len(result_set) > 0: 
    108105            Logger.get('RecMan').debug("result_set: %s" % str(result_set)) 
    109             idLecture = result_set[0] 
    110         elif result_set is not None and len(result_set) > 0 and match_umich: 
    111106            idLecture = result_set[0] 
    112107        else: 
     
    156151        connection.close() 
    157152 
    158         return cls.getIdLecture(lecture_name, pattern_cern, pattern_umich) 
     153        return cls.getIdLecture(lecture_name) 
    159154 
    160155    @classmethod 
     
    220215 
    221216    @classmethod 
    222     def updateMicala(cls, IndicoID, contentType, LODBID): 
     217    def associateIndicoIDToLOID(cls, IndicoID, LODBID): 
    223218        """Update the micala DB to associate the given talk with the given LOID""" 
    224219 
     
    227222        result      = "" 
    228223 
    229         Logger.get('RecMan').debug("in updateMicala()") 
    230  
    231         if contentType == 'web_lecture': 
    232             try: 
    233                 connection = MySQLdb.connect(host   = CollaborationTools.getOptionValue("RecordingManager", "micalaDBServer"), 
    234                                              port   = int(CollaborationTools.getOptionValue("RecordingManager", "micalaDBPort")), 
    235                                              user   = CollaborationTools.getOptionValue("RecordingManager", "micalaDBUser"), 
    236                                              passwd = CollaborationTools.getOptionValue("RecordingManager", "micalaDBPW"), 
    237                                              db     = CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) 
    238             except MySQLdb.Error, e: 
    239                 flagSuccess = False 
    240                 result += "MySQL error %d: %s" % (e.args[0], e.args[1]) 
    241             except Exception, e: 
    242                 flagSuccess = False 
    243                 result += "Unknown error %d: %s" % (e.args[0], e.args[1]) 
    244  
    245             cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) 
    246  
    247             try: 
    248                 cursor.execute("UPDATE Lectures SET IndicoID=%s WHERE id=%s", 
    249                                (IndicoID, LODBID)) 
    250                 connection.commit() 
    251             except MySQLdb.Error, e: 
    252                 flagSuccess = False 
    253                 result += "MySQL error %d: %s" % (e.args[0], e.args[1]) 
    254             except Exception, e: 
    255                 flagSuccess = False 
    256                 result += "Unknown error %d: %s" % (e.args[0], e.args[1]) 
    257  
    258             cursor.close() 
    259             connection.close() 
    260  
    261         elif contentType == 'plain_video': 
    262             # do nothing, since a record in Lectures should already have been created by createCDSRecord() 
    263             pass 
     224        Logger.get('RecMan').debug("in associateIndicoIDToLOID()") 
     225 
     226        try: 
     227            connection = MySQLdb.connect(host   = CollaborationTools.getOptionValue("RecordingManager", "micalaDBServer"), 
     228                                         port   = int(CollaborationTools.getOptionValue("RecordingManager", "micalaDBPort")), 
     229                                         user   = CollaborationTools.getOptionValue("RecordingManager", "micalaDBUser"), 
     230                                         passwd = CollaborationTools.getOptionValue("RecordingManager", "micalaDBPW"), 
     231                                         db     = CollaborationTools.getOptionValue("RecordingManager", "micalaDBName")) 
     232        except MySQLdb.Error, e: 
     233            flagSuccess = False 
     234            result += "MySQL error %d: %s" % (e.args[0], e.args[1]) 
     235        except Exception, e: 
     236            flagSuccess = False 
     237            result += "Unknown error %d: %s" % (e.args[0], e.args[1]) 
     238 
     239        cursor = connection.cursor(cursorclass=MySQLdb.cursors.DictCursor) 
     240 
     241        try: 
     242            cursor.execute("UPDATE Lectures SET IndicoID=%s WHERE id=%s", 
     243                           (IndicoID, LODBID)) 
     244            connection.commit() 
     245        except MySQLdb.Error, e: 
     246            flagSuccess = False 
     247            result += "MySQL error %d: %s" % (e.args[0], e.args[1]) 
     248        except Exception, e: 
     249            flagSuccess = False 
     250            result += "Unknown error %d: %s" % (e.args[0], e.args[1]) 
     251 
     252        cursor.close() 
     253        connection.close() 
    264254 
    265255        return {"success": flagSuccess, "result": result} 
     
    333323                idMachine = cls.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName")) 
    334324                idTask    = cls.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS")) 
    335                 import re 
    336                 pattern_cern  = re.compile('([sc\d]+)$') 
    337                 pattern_umich = re.compile('(\d+\-[\w\d]+\-\d)$') 
    338                 idLecture = cls.getIdLecture(pending, pattern_cern, pattern_umich) 
     325                idLecture = cls.getIdLecture(pending) 
    339326                cls.reportStatus("COMPLETE", "CDS record: %s" % new_record, idMachine, idTask, idLecture) 
    340327 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/services.py

    r0cb016 r65953b  
    2424from MaKaC.plugins.Collaboration.RecordingManager.common import createIndicoLink, createCDSRecord, submitMicalaMetadata 
    2525from MaKaC.plugins.Collaboration.RecordingManager.micala import MicalaCommunication 
    26  
    27 class RMLinkService(CollaborationPluginServiceBase): 
    28  
    29     def _checkParams(self): 
    30         CollaborationPluginServiceBase._checkParams(self) #puts the Conference in self._conf 
    31         self._IndicoID = self._params.get('IndicoID', None) 
    32         self._LOID     = self._params.get('LOID', None) 
    33  
    34         if not self._IndicoID: 
    35             raise RecordingManagerException("No IndicoID supplied") 
    36         if not self._LOID: 
    37             raise RecordingManagerException("No LOID supplied") 
    38  
    39     def _getAnswer(self): 
    40 #        here is where we make a submission to the database? 
    41         MicalaCommunication.updateMicala(self._params.get('IndicoID', None), self._params.get('LOID', None)) 
    42         return {'some':'thing'} 
    4326 
    4427class RMCreateCDSRecordService(CollaborationPluginServiceBase): 
     
    7356 
    7457    def _getAnswer(self): 
     58        """This method does everything necessary to create a CDS record and also update the micala database. 
     59        For plain_video talks, it does the following: 
     60         - calls createCDSRecord(), 
     61                 which generates the MARC XML, 
     62                 submits it to CDS, 
     63                 and makes sure a record for this talk exists in micala DB 
     64        For web_lecture talks, it does the following: 
     65         - calls createCDSRecord(), 
     66                 which generates the MARC XML and submits it to CDS 
     67         - calls associateIndicoIDToLOID(), 
     68                 which associates the chosen IndicoID to the existing record of the LOID in micala DB 
     69                 (no need to create a new record, because the user is only allowed to choose LOID's that are already in the micala DB) 
     70         - calls submitMicalaMetadata(), which generates the micala lecture.xml and submits it to micala DB. 
     71        All of these methods update their status to micala DB. 
     72        """ 
     73 
     74        ################################################################### 
     75        # FOR DEBUGGING 
     76        resultSubmitMicalaMetadata = submitMicalaMetadata(self._aw, 
     77                                                          self._IndicoID, 
     78                                                          self._contentType, 
     79                                                          self._LODBID, 
     80                                                          self._params.get('LOID', None), 
     81                                                          self._videoFormat, 
     82                                                          self._languages) 
     83        if resultSubmitMicalaMetadata["success"] == False: 
     84            raise RecordingManagerException("CDS record creation failed.\n%s" % resultSubmitMicalaMetadata["result"]) 
     85            return "micala metadata creation aborted." 
     86 
     87        return 
     88        # /FOR DEBUGGING! 
     89        ################################################################### 
     90 
    7591        # Get the MARC XML and submit it to CDS, 
    76         # then update micala database Status table showing task completed 
     92        # then update micala database Status table showing task completed. 
     93        # do this for both plain_video and web_lecture talks 
    7794        resultCreateCDSRecord = createCDSRecord(self._aw, 
    7895                                                self._IndicoID, 
     96                                                self._LODBID, 
    7997                                                self._contentType, 
    8098                                                self._videoFormat, 
    8199                                                self._languages) 
    82  
    83100        if resultCreateCDSRecord["success"] == False: 
    84101            raise RecordingManagerException("CDS record creation failed.\n%s" % resultCreateCDSRecord["result"]) 
    85102            return "CDS record creation aborted." 
    86103 
    87         # Create lecture.xml and submit to micala server, 
    88         # then update micala database Status table showing task completed 
    89         # (this only makes sense if it is a web lecture) 
    90104        if self._contentType == 'web_lecture': 
     105            # Update the micala database to match the LODBID with the IndicoID 
     106            # This only makes sense for web_lecture talks 
     107            # (for plain_video, a record in Lectures should already have been created by createCDSRecord() ) 
     108            resultAssociateIndicoIDToLOID = MicalaCommunication.associateIndicoIDToLOID(self._IndicoID, 
     109                                              self._params.get('LODBID', None)) 
     110            if resultAssociateIndicoIDToLOID["success"] == False: 
     111                raise RecordingManagerException("micala database update failed.\n%s" % resultAssociateIndicoIDToLOID["result"]) 
     112                return "CDS record creation aborted." 
     113 
     114            # Create lecture.xml and submit to micala server, 
     115            # then update micala database Status table showing task completed 
     116            # (this only makes sense if it is a web_lecture) 
    91117            resultSubmitMicalaMetadata = submitMicalaMetadata(self._aw, 
    92118                                                              self._IndicoID, 
    93119                                                              self._contentType, 
     120                                                              self._LODBID, 
    94121                                                              self._params.get('LOID', None), 
    95122                                                              self._videoFormat, 
    96123                                                              self._languages) 
    97  
    98124            if resultSubmitMicalaMetadata["success"] == False: 
    99125                raise RecordingManagerException("CDS record creation failed.\n%s" % resultSubmitMicalaMetadata["result"]) 
    100126                return "micala metadata creation aborted." 
    101  
    102         # Update the micala database to match the LODBID with the IndicoID 
    103         # This only makes sense for web lectures, so if contentType is plain_video, 
    104         # this method does nothing. 
    105         resultUpdateMicala = MicalaCommunication.updateMicala(self._IndicoID, 
    106                                           self._contentType, 
    107                                           self._params.get('LODBID', None)) 
    108  
    109         if resultUpdateMicala["success"] == False: 
    110             raise RecordingManagerException("micala database update failed.\n%s" % resultUpdateMicala["result"]) 
    111             return "CDS record creation aborted." 
    112  
    113127 
    114128        return "Successfully updated micala database and submitted CDS record for creation." 
  • indico/MaKaC/plugins/Collaboration/RecordingManager/tpls/Extra.js

    r2349da r65953b  
    351351 
    352352    RMMatchSummaryMessageUpdate(); 
    353 } 
    354  
    355 function RMLink() { 
    356     //RMselectedTalk 
    357     //RMselectedLO 
    358  
    359     var killProgress = IndicoUI.Dialogs.Util.progress($T("doing something")); 
    360  
    361     indicoRequest('collaboration.pluginService', 
    362             { 
    363                 plugin: 'RecordingManager', 
    364                 service: 'RMLink', 
    365                 conference: '<%= ConferenceId %>', 
    366                 IndicoID: RMselectedTalkId, 
    367                 LOID: RMselectedLODBID 
    368             }, 
    369         function(result, error){ 
    370             if (!error) { 
    371 // I don't have anything here yet. This is where we could do something with the result if we want. Don't know what that would be. 
    372                 killProgress(); // turn off the progress indicator 
    373             } else { 
    374                 killProgress(); // turn off the progress indicator 
    375                 IndicoUtil.errorReport(error); 
    376             } 
    377         } 
    378     ); 
    379353} 
    380354 
  • indico/MaKaC/webinterface/stylesheets/micala_lecture_conference.xsl

    r0cb016 r65953b  
    2525<xsl:template match="event"> 
    2626 
    27 <!--  <!DOCTYPE LECTURE SYSTEM "http://www.wlap.org/dtd/lecture.dtd">  --> 
     27<!--  <!DOCTYPE LECTURE SYSTEM "http://www.wlap.org/dtd/lecture.dtd"> --> 
    2828<LECTURE> 
    2929  <TITLE><xsl:value-of select="./title" /></TITLE> 
    30   <xsl:for-each select="./chair/user"> 
    31     <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
    32   </xsl:for-each> 
     30  <xsl:choose> 
     31    <xsl:when test="./chair/user != ''"> 
     32      <xsl:for-each select="./chair/user"> 
     33        <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
     34      </xsl:for-each> 
     35    </xsl:when> 
     36    <xsl:otherwise> 
     37      <AUTHOR>no speaker given</AUTHOR> 
     38    </xsl:otherwise> 
     39  </xsl:choose> 
    3340  <DATE><xsl:value-of select="substring(./startDate, 0, 11)" /></DATE> 
    3441  <LANGUAGE> 
     
    5360    </VIDEO> 
    5461    <SEQ TITLE="Sequence of slides" REGION="slide" > 
    55       <SLIDE TYPE="DUMMY" /> 
     62        <!-- This section will be populated by a list of slide timings later --> 
    5663    </SEQ> 
    5764  </PAR> 
  • indico/MaKaC/webinterface/stylesheets/micala_lecture_contribution.xsl

    r0cb016 r65953b  
    2828<LECTURE> 
    2929  <TITLE><xsl:value-of select="./contribution/title" /></TITLE> 
    30   <xsl:for-each select="./contribution/speakers/user"> 
    31     <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
    32   </xsl:for-each> 
     30  <xsl:choose> 
     31    <xsl:when test="./contribution/speakers/user != ''"> 
     32      <xsl:for-each select="./contribution/speakers/user"> 
     33        <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
     34      </xsl:for-each> 
     35    </xsl:when> 
     36    <xsl:otherwise> 
     37      <AUTHOR>no speaker given</AUTHOR> 
     38    </xsl:otherwise> 
     39  </xsl:choose> 
    3340  <DATE><xsl:value-of select="substring(./startDate, 0, 11)" /></DATE> 
    3441  <LANGUAGE> 
     
    5360    </VIDEO> 
    5461    <SEQ TITLE="Sequence of slides" REGION="slide" > 
    55       <SLIDE TYPE="DUMMY" /> 
     62        <!-- This section will be populated by a list of slide timings later --> 
    5663    </SEQ> 
    5764  </PAR> 
  • indico/MaKaC/webinterface/stylesheets/micala_lecture_session.xsl

    r0cb016 r65953b  
    2828<LECTURE> 
    2929  <TITLE><xsl:value-of select="./session/title" /></TITLE> 
    30   <xsl:for-each select="./session/speakers/user"> 
    31     <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
    32   </xsl:for-each> 
     30  <xsl:choose> 
     31    <xsl:when test="./session/speakers/user != ''"> 
     32      <xsl:for-each select="./session/speakers/user"> 
     33        <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
     34      </xsl:for-each> 
     35    </xsl:when> 
     36    <xsl:otherwise> 
     37      <AUTHOR>no speaker given</AUTHOR> 
     38    </xsl:otherwise> 
     39  </xsl:choose> 
    3340  <DATE><xsl:value-of select="substring(./startDate, 0, 11)" /></DATE> 
    3441  <LANGUAGE> 
     
    5360    </VIDEO> 
    5461    <SEQ TITLE="Sequence of slides" REGION="slide" > 
    55       <SLIDE TYPE="DUMMY" /> 
     62        <!-- This section will be populated by a list of slide timings later --> 
    5663    </SEQ> 
    5764  </PAR> 
  • indico/MaKaC/webinterface/stylesheets/micala_lecture_subcontribution.xsl

    r0cb016 r65953b  
    2828<LECTURE> 
    2929  <TITLE><xsl:value-of select="./contribution/subcontribution/title" /></TITLE> 
    30   <xsl:for-each select="./contribution/subcontribution/speakers/user"> 
    31     <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
    32   </xsl:for-each> 
     30  <xsl:choose> 
     31    <xsl:when test="./contribution/subcontribution/speakers/user != ''"> 
     32      <xsl:for-each select="./contribution/subcontribution/speakers/user"> 
     33        <AUTHOR><xsl:apply-templates select="./name"/></AUTHOR> 
     34      </xsl:for-each> 
     35    </xsl:when> 
     36    <xsl:otherwise> 
     37      <AUTHOR>no speaker given</AUTHOR> 
     38    </xsl:otherwise> 
     39  </xsl:choose> 
    3340  <DATE><xsl:value-of select="substring(./startDate, 0, 11)" /></DATE> 
    3441  <LANGUAGE> 
     
    5360    </VIDEO> 
    5461    <SEQ TITLE="Sequence of slides" REGION="slide" > 
    55       <SLIDE TYPE="DUMMY" /> 
     62        <!-- This section will be populated by a list of slide timings later --> 
    5663    </SEQ> 
    5764  </PAR> 
Note: See TracChangeset for help on using the changeset viewer.