Changeset 042bea in indico


Ignore:
Timestamp:
10/21/10 10:39:16 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
new-webex
Children:
5d34ab
Parents:
a238e2
git-author:
Kevin Flannery <flannery@…> (08/04/10 22:10:24)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (10/21/10 10:39:16)
Message:

Added ability to display session specific video bookings on the meetings and lectures display pages

Location:
indico/MaKaC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/common/output.py

    ra238e2 r042bea  
    661661        out.writeTag("ID",session.getId()) 
    662662 
    663         if PluginsHolder().getPluginType("Collaboration").hasPlugin("WebEx") and PluginsHolder().getPluginType("Collaboration").getPlugin("WebEx").isActive(): 
    664             Logger.get('RecMan').info("WebEx is active. Printing out list of WebEx bookings") 
    665             csbm = conf.getCSBookingManager() 
    666             bookings = csbm.getBookingList(filterByType = "WebEx", notify = False, onlyPublic = True) 
    667             bookings.sort(key = lambda b: b.getStartDate() or minDatetime()) 
    668             for b in bookings: 
    669                 Logger.get('WebEx').info("Session for booking %s, session id: %s " % ( str(b._getTitle()), str(b.getSessionId()) ) ) 
    670                 if session.getId() == b.getSessionId(): 
    671                     Logger.get('WebEx').info("Found matching session for video booking!, session id: %s " % ( b.getSessionId() ) ) 
    672                     out.openTag("videoBooking") 
    673                     out.writeTag("videoBookingTitle",b._getTitle()) 
    674                     out.writeTag("videoBookingUrl",b.getURL()) 
    675                     out.closeTag("videoBooking") 
     663        # The following code prints out the video bookings associated with a particular session 
     664        csbm = conf.getCSBookingManager() 
     665        pluginsWithSessionBookings = csbm.getEventSessionDisplayPlugins() 
     666        for pluginName in pluginsWithSessionBookings: 
     667            if PluginsHolder().hasPluginType("Collaboration") and PluginsHolder().getPluginType("Collaboration").hasPlugin(pluginName) and PluginsHolder().getPluginType("Collaboration").getPlugin(pluginName).isActive(): 
     668                Logger.get('output.py-Printing Sessions').info("%s is active. Printing out list of bookings" % pluginName) 
     669                bookings = csbm.getBookingList(filterByType = "WebEx", notify = False, onlyPublic = True) 
     670                bookings.sort(key = lambda b: b.getStartDate() or minDatetime()) 
     671                for b in bookings: 
     672                    #Logger.get('WebEx').info("Session for booking %s, session id: %s " % ( str(b._getTitle()), str(b.getSessionId()) ) ) 
     673                    if session.getId() == b.getSessionId(): 
     674                        #Logger.get('WebEx').info("Found matching session for video booking!, session id: %s " % ( b.getSessionId() ) ) 
     675                        out.openTag("videoBooking") 
     676                        out.writeTag("videoBookingTitle",b._getTitle()) 
     677                        out.writeTag("videoBookingUrl",b.getURL()) 
     678                        out.writeTag("videoBookingType",pluginName) 
     679                        out.closeTag("videoBooking") 
    676680 
    677681 
  • indico/MaKaC/plugins/Collaboration/WebEx/collaboration.py

    ra238e2 r042bea  
    7272 
    7373    _hasEventDisplay = True 
     74    _hasEventSessionDisplay = True 
    7475 
    7576    _commonIndexes = ["All Videoconference"] 
  • indico/MaKaC/plugins/Collaboration/WebEx/pages.py

    ra238e2 r042bea  
    136136            out.closeTag("section") 
    137137        out.openTag("section") 
     138        out.writeTag("title", _('Title:')) 
     139        out.writeTag("line", booking._bookingParams["meetingTitle"]) 
     140        out.closeTag("section") 
     141 
     142        out.openTag("section") 
    138143        out.writeTag("title", _('Agenda:')) 
    139144        out.writeTag("line", booking._bookingParams["meetingDescription"]) 
  • indico/MaKaC/plugins/Collaboration/base.py

    r2f05ce r042bea  
    627627 
    628628 
     629    def getEventSessionDisplayPlugins(self, sorted = False): 
     630        """ Returns a list of names (strings) of plugins which have been configured 
     631            as showing bookings in the event display page under a specific session, and which have bookings 
     632            already (or previously) created in the event. 
     633            (does not check if the bookings are hidden or not) 
     634        """ 
     635 
     636        pluginsWithEventSessionDisplay = CollaborationTools.pluginsWithEventSessionDisplay() 
     637        l = [] 
     638        for pluginName in self._bookingsByType: 
     639            if pluginName in pluginsWithEventSessionDisplay: 
     640                l.append(pluginName) 
     641        if sorted: 
     642            l.sort() 
     643        return l 
     644 
    629645    def getEventDisplayPlugins(self, sorted = False): 
    630646        """ Returns a list of names (strings) of plugins which have been configured 
     
    717733    _hasStartDate = True 
    718734    _hasEventDisplay = False 
     735    _hasEventSessionDisplay = False 
    719736    _hasTitle = False 
    720737    _adminOnly = False 
     
    13671384        return self._hasEventDisplay 
    13681385 
     1386    def hasEventSessionDisplay(self): 
     1387        """ Returns if the type of this booking should display something on 
     1388            an event display page 
     1389        """ 
     1390        return self._hasEventSessionDisplay 
     1391 
    13691392    def isAdminOnly(self): 
    13701393        """ Returns if this booking / this booking's plugin pages should only be displayed 
  • indico/MaKaC/plugins/Collaboration/collaborationTools.py

    rd25c08 r042bea  
    3030from MaKaC.fossils.conference import IConferenceFossil 
    3131 
     32from MaKaC.common.logger import Logger 
     33 
    3234class CollaborationTools(object): 
    3335    """ Class with utility classmethods for the Collaboration plugins core and plugins 
     
    282284            if cls.getCSBookingClass(pluginName)._hasEventDisplay: 
    283285                l.append(pluginName) 
     286        return l 
     287 
     288    @classmethod 
     289    def pluginsWithEventSessionDisplay(cls): 
     290        """ Utility function that returns a list of strings with the names of the 
     291            collaboration plugins that want to display something in event display pages 
     292        """ 
     293        l = [] 
     294        for pluginName in cls.getCollaborationPluginType().getPlugins(): 
     295            Logger.get('Found plugins').info("pluginName = %s" % ( pluginName ) ) 
     296            try: 
     297                if cls.getCSBookingClass(pluginName)._hasEventSessionDisplay: 
     298                    Logger.get('Found plugins').info("%s has session display" % ( pluginName ) ) 
     299                    l.append(pluginName) 
     300            except AttributeError, err: 
     301                Logger.get('Found plugins').info("AttributeError on pluginName = %s" % ( pluginName ) ) 
     302                pass 
    284303        return l 
    285304 
  • indico/MaKaC/webinterface/stylesheets/include/indico.xsl

    ra238e2 r042bea  
    158158            <tr> 
    159159              <td class="leftCol"> 
    160                 Video Booking 
     160                <xsl:value-of select="./videoBookingType"/>: 
    161161              </td> 
    162162              <td> 
Note: See TracChangeset for help on using the changeset viewer.