def _checkStatus(self):
        if self._created:
            params = self.getBookingParams()
            request_xml = """<?xml version="1.0" encoding="ISO-8859-1"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <header>
      <securityContext>
         <webExID>%(username)s</webExID>
         <password>%(password)s</password>
         <siteID>%(siteID)s</siteID>
         <partnerID>%(partnerID)s</partnerID>
      </securityContext>
   </header>
   <body>
      <bodyContent xsi:type="java:com.webex.service.binding.meeting.GetMeeting">
         <meetingKey>%(webex_key)s</meetingKey>
      </bodyContent>
   </body>
</serv:message>

""" % { "username" : params['webExUser'], "password" : self.getWebExPass(), "siteID" : getWebExOptionValueByName("WESiteID"), "partnerID" : getWebExOptionValueByName("WEPartnerID"), "webex_key": self.getWebExKey() }
            response_xml = sendXMLRequest( request_xml )
            dom = xml.dom.minidom.parseString( response_xml )
            status = dom.getElementsByTagName( "serv:result" )[0].firstChild.toxml('utf-8')
            if status != "SUCCESS":
                errorID = dom.getElementsByTagName( "serv:exceptionID" )[0].firstChild.toxml('utf-8')
                errorReason = dom.getElementsByTagName( "serv:reason" )[0].firstChild.toxml('utf-8')
                return WebExError( errorID, userMessage = errorReason )
            self.assignAttributes( response_xml )
        return None
    def getWebExTimeZoneToUTC( self, tz_id, the_date ):
        """
        The date is required because the WebEx server
        responds with the offset of GMT time based
        on that date, adjusted for daylight savings, etc
        """
        params = self.getBookingParams()
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="site.LstTimeZone" >
    <timeZoneID>%(tz_id)s</timeZoneID>
    <date>%(date)s</date>
  </bodyContent>
</body>
</serv:message>
""" % ( { "username" : params['webExUser'], "password" : self.getWebExPass(), "siteID" : getWebExOptionValueByName("WESiteID"), "partnerID" : getWebExOptionValueByName("WEPartnerID"), "tz_id":tz_id, "date":the_date } )
        response_xml = sendXMLRequest( request_xml )
        dom = xml.dom.minidom.parseString( response_xml )
        offset = dom.getElementsByTagName( "ns1:gmtOffset" )[0].firstChild.toxml('utf-8')
        try:
            return int(offset)
        except:
            Logger.get('WebEx').debug( "Eror requesting time zone offset from WebEx:\n\n%s" % ( response_xml ) )
            return None
    def getLoginURL(self):
        """ Starts an WebEx meeting.
            A last check on the WebEx server is performed.
        """
        params = self.getBookingParams()
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.GetjoinurlMeeting" >
    <sessionKey>%(webExKey)s</sessionKey>
    <meetingPW>%(meetingPW)s</meetingPW>
  </bodyContent>
</body>
</serv:message>
""" % ( { "username" : params['webExUser'], "password" : self.getWebExPass(), "siteID" : getWebExOptionValueByName("WESiteID"), "partnerID" : getWebExOptionValueByName("WEPartnerID"), "webExKey":self.getWebExKey(), 'meetingPW':self.getAccessPassword() } )
        response_xml = sendXMLRequest( request_xml )
        dom = xml.dom.minidom.parseString( response_xml )
        status = dom.getElementsByTagName( "serv:result" )[0].firstChild.toxml('utf-8')
        if status == "SUCCESS":
            self._url = dom.getElementsByTagName( "meet:joinMeetingURL" )[0].firstChild.toxml('utf-8').replace('&amp;','&')
        else:
            return WebExError( errorType = None, userMessage = _("There was an error attempting to get the join booking URL from the WebEx server.") )
        return None
Exemple #4
0
    def _start(self):
        """ Starts an WebEx meeting.
            A last check on the WebEx server is performed.
        """
        self._checkStatus()
        if self._canBeStarted:
            params = self.getBookingParams()
            request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.GethosturlMeeting" >
    <sessionKey>%(webExKey)s</sessionKey>
  </bodyContent>
</body>
</serv:message>
""" % ({
                "username": params['webExUser'],
                "password": self.getWebExPass(),
                "siteID": getWebExOptionValueByName("WESiteID"),
                "partnerID": getWebExOptionValueByName("WEPartnerID"),
                "webExKey": self.getWebExKey()
            })
            try:
                response_xml = sendXMLRequest(request_xml)
            except Exception, e:
                Logger.get('WebEx').error(
                    """Could not start booking with id %s of event with id %s, exception: %s"""
                    % (self.getId(), self.getConference().getId(), str(e)))
                self._warning = _(
                    "There was an error in sending the emails to administrators: %s"
                    % str(e))
            dom = xml.dom.minidom.parseString(response_xml)
            status = dom.getElementsByTagName(
                "serv:result")[0].firstChild.toxml('utf-8')
            if status == "SUCCESS":
                self._startURL = dom.getElementsByTagName(
                    "meet:hostMeetingURL")[0].firstChild.toxml('utf-8')
            else:
                return WebExError(
                    errorType=None,
                    userMessage=
                    _("There was an error attempting to get the start booking URL from the WebEx server."
                      ))
Exemple #5
0
    def getLoginURL(self):
        """ Starts an WebEx meeting.
            A last check on the WebEx server is performed.
        """
        params = self.getBookingParams()
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.GetjoinurlMeeting" >
    <sessionKey>%(webExKey)s</sessionKey>
    <meetingPW>%(meetingPW)s</meetingPW>
  </bodyContent>
</body>
</serv:message>
""" % ({
            "username": params['webExUser'],
            "password": self.getWebExPass(),
            "siteID": getWebExOptionValueByName("WESiteID"),
            "partnerID": getWebExOptionValueByName("WEPartnerID"),
            "webExKey": self.getWebExKey(),
            'meetingPW': self.getAccessPassword()
        })
        response_xml = sendXMLRequest(request_xml)
        dom = xml.dom.minidom.parseString(response_xml)
        status = dom.getElementsByTagName("serv:result")[0].firstChild.toxml(
            'utf-8')
        if status == "SUCCESS":
            self._url = dom.getElementsByTagName(
                "meet:joinMeetingURL")[0].firstChild.toxml('utf-8').replace(
                    '&amp;', '&')
        else:
            return WebExError(
                errorType=None,
                userMessage=
                _("There was an error attempting to get the join booking URL from the WebEx server."
                  ))
        return None
Exemple #6
0
    def getWebExTimeZoneToUTC(self, tz_id, the_date):
        """
        The date is required because the WebEx server
        responds with the offset of GMT time based
        on that date, adjusted for daylight savings, etc
        """
        params = self.getBookingParams()
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="site.LstTimeZone" >
    <timeZoneID>%(tz_id)s</timeZoneID>
    <date>%(date)s</date>
  </bodyContent>
</body>
</serv:message>
""" % ({
            "username": params['webExUser'],
            "password": self.getWebExPass(),
            "siteID": getWebExOptionValueByName("WESiteID"),
            "partnerID": getWebExOptionValueByName("WEPartnerID"),
            "tz_id": tz_id,
            "date": the_date
        })
        response_xml = sendXMLRequest(request_xml)
        dom = xml.dom.minidom.parseString(response_xml)
        offset = dom.getElementsByTagName("ns1:gmtOffset")[0].firstChild.toxml(
            'utf-8')
        try:
            return int(offset)
        except:
            Logger.get('WebEx').debug(
                "Eror requesting time zone offset from WebEx:\n\n%s" %
                (response_xml))
            return None
Exemple #7
0
    def _checkStatus(self):
        if self._created:
            params = self.getBookingParams()
            request_xml = """<?xml version="1.0" encoding="ISO-8859-1"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <header>
      <securityContext>
         <webExID>%(username)s</webExID>
         <password>%(password)s</password>
         <siteID>%(siteID)s</siteID>
         <partnerID>%(partnerID)s</partnerID>
      </securityContext>
   </header>
   <body>
      <bodyContent xsi:type="java:com.webex.service.binding.meeting.GetMeeting">
         <meetingKey>%(webex_key)s</meetingKey>
      </bodyContent>
   </body>
</serv:message>

""" % {
                "username": params['webExUser'],
                "password": self.getWebExPass(),
                "siteID": getWebExOptionValueByName("WESiteID"),
                "partnerID": getWebExOptionValueByName("WEPartnerID"),
                "webex_key": self.getWebExKey()
            }
            response_xml = sendXMLRequest(request_xml)
            dom = xml.dom.minidom.parseString(response_xml)
            status = dom.getElementsByTagName(
                "serv:result")[0].firstChild.toxml('utf-8')
            if status != "SUCCESS":
                errorID = dom.getElementsByTagName(
                    "serv:exceptionID")[0].firstChild.toxml('utf-8')
                errorReason = dom.getElementsByTagName(
                    "serv:reason")[0].firstChild.toxml('utf-8')
                return WebExError(errorID, userMessage=errorReason)
            self.assignAttributes(response_xml)
        return None
    def _start(self):
        """ Starts an WebEx meeting.
            A last check on the WebEx server is performed.
        """
        self._checkStatus()
        if self._canBeStarted:
            params = self.getBookingParams()
            request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.GethosturlMeeting" >
    <sessionKey>%(webExKey)s</sessionKey>
  </bodyContent>
</body>
</serv:message>
""" % ( { "username" : params['webExUser'], "password" : self.getWebExPass(), "siteID" : getWebExOptionValueByName("WESiteID"), "partnerID" : getWebExOptionValueByName("WEPartnerID"), "webExKey":self.getWebExKey() } )
            try:
                response_xml = sendXMLRequest( request_xml )
            except Exception,e:
                Logger.get('WebEx').error(
                    """Could not start booking with id %s of event with id %s, exception: %s""" %
                    (self.getId(), self.getConference().getId(), str(e)))
                self._warning = _("There was an error in sending the emails to administrators: %s" % str(e) )
            dom = xml.dom.minidom.parseString( response_xml )
            status = dom.getElementsByTagName( "serv:result" )[0].firstChild.toxml('utf-8')
            if status == "SUCCESS":
                self._startURL = dom.getElementsByTagName( "meet:hostMeetingURL" )[0].firstChild.toxml('utf-8')
            else:
                return WebExError( errorType = None, userMessage = _("There was an error attempting to get the start booking URL from the WebEx server.") )
Exemple #9
0
    def createBooking( cls, booking ):
        params = booking.getBookingParams()
        participant_xml = makeParticipantXML(booking._participants)
        start_date = booking.getAdjustedStartDate('UTC').strftime( "%m/%d/%Y %H:%M" )
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.CreateMeeting" xmlns:meet="http://www.webex.com/schemas/2002/06/service/meeting" >
    <accessControl>
      <meetingPassword>%(meetingPassword)s</meetingPassword>
    </accessControl>
    <metaData>
      <confName>%(meetingName)s</confName>
      <agenda>%(description)s</agenda>
    </metaData>
    %(participants)s
    <enableOptions>
      <attendeeList>%(seeParticipants)s</attendeeList>
      <audioVideo>true</audioVideo>
      <chat>true</chat>
      <chatAllAttendees>%(enableChat)s</chatAllAttendees>
      <chatHost>true</chatHost>
      <chatPresenter>true</chatPresenter>
      <desktopShare>true</desktopShare>
      <fullScreen>true</fullScreen>
      <poll>true</poll>
      <presentation>true</presentation>
    </enableOptions>
    <schedule>
      <duration>%(duration)s</duration>
      <joinTeleconfBeforeHost>%(joinBeforeHost)s</joinTeleconfBeforeHost>
      <openTime>%(openTime)s</openTime>
      <startDate>%(startDate)s:00</startDate>
      <timeZoneID>20</timeZoneID><!--Zone 20 is Greenwich GMT/UTC-->
    </schedule>
    <telephony>
      <telephonySupport>CALLIN</telephonySupport>
    </telephony>
  </bodyContent>
</body>
</serv:message>

""" % ( { "username" : params['webExUser'], "password" : escape(params['webExPass']), "siteID" : getWebExOptionValueByName("WESiteID"), "partnerID" : getWebExOptionValueByName("WEPartnerID"), "meetingPassword": escape(params['accessPassword']), "startDate" : start_date, "duration" : booking.getDuration(), "meetingName" : escape(params['meetingTitle']), "description" : escape(params['meetingDescription']), "participants": participant_xml, "openTime":params['joinBeforeTime'], "seeParticipants": booking.getSeeParticipants(), "enableChat": booking.getEnableChat(), "joinBeforeHost": booking.getJoinBeforeHost() } )
        response_xml = sendXMLRequest( request_xml )
        dom = xml.dom.minidom.parseString( response_xml )
        status = dom.getElementsByTagName( "serv:result" )[0].firstChild.toxml('utf-8')
        if status == "SUCCESS":
            booking.setWebExKey( dom.getElementsByTagName( "meet:meetingkey" )[0].firstChild.toxml('utf-8') )
        else:
            booking._url = ""
            errorID = dom.getElementsByTagName( "serv:exceptionID" )[0].firstChild.toxml('utf-8')
            errorReason = dom.getElementsByTagName( "serv:reason" )[0].firstChild.toxml('utf-8')
            return WebExError( errorID, userMessage = errorReason )
Exemple #10
0
    def createBooking(cls, booking):
        params = booking.getBookingParams()
        participant_xml = makeParticipantXML(booking._participants)
        start_date = booking.getAdjustedStartDate('UTC').strftime(
            "%m/%d/%Y %H:%M")
        request_xml = """<?xml version="1.0\" encoding="UTF-8"?>
<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:serv=\"http://www.webex.com/schemas/2002/06/service" >
<header>
  <securityContext>
    <webExID>%(username)s</webExID>
    <password>%(password)s</password>
    <siteID>%(siteID)s</siteID>
    <partnerID>%(partnerID)s</partnerID>
  </securityContext>
</header>
<body>
  <bodyContent xsi:type="java:com.webex.service.binding.meeting.CreateMeeting" xmlns:meet="http://www.webex.com/schemas/2002/06/service/meeting" >
    <accessControl>
      <meetingPassword>%(meetingPassword)s</meetingPassword>
    </accessControl>
    <metaData>
      <confName>%(meetingName)s</confName>
      <agenda>%(description)s</agenda>
    </metaData>
    %(participants)s
    <enableOptions>
      <attendeeList>%(seeParticipants)s</attendeeList>
      <audioVideo>true</audioVideo>
      <chat>true</chat>
      <chatAllAttendees>%(enableChat)s</chatAllAttendees>
      <chatHost>true</chatHost>
      <chatPresenter>true</chatPresenter>
      <desktopShare>true</desktopShare>
      <fullScreen>true</fullScreen>
      <poll>true</poll>
      <presentation>true</presentation>
    </enableOptions>
    <schedule>
      <duration>%(duration)s</duration>
      <joinTeleconfBeforeHost>%(joinBeforeHost)s</joinTeleconfBeforeHost>
      <openTime>%(openTime)s</openTime>
      <startDate>%(startDate)s:00</startDate>
      <timeZoneID>20</timeZoneID><!--Zone 20 is Greenwich GMT/UTC-->
    </schedule>
    <telephony>
      <telephonySupport>CALLIN</telephonySupport>
    </telephony>
  </bodyContent>
</body>
</serv:message>

""" % ({
            "username": params['webExUser'],
            "password": escape(params['webExPass']),
            "siteID": getWebExOptionValueByName("WESiteID"),
            "partnerID": getWebExOptionValueByName("WEPartnerID"),
            "meetingPassword": escape(params['accessPassword']),
            "startDate": start_date,
            "duration": booking.getDuration(),
            "meetingName": escape(params['meetingTitle']),
            "description": escape(params['meetingDescription']),
            "participants": participant_xml,
            "openTime": params['joinBeforeTime'],
            "seeParticipants": booking.getSeeParticipants(),
            "enableChat": booking.getEnableChat(),
            "joinBeforeHost": booking.getJoinBeforeHost()
        })
        response_xml = sendXMLRequest(request_xml)
        dom = xml.dom.minidom.parseString(response_xml)
        status = dom.getElementsByTagName("serv:result")[0].firstChild.toxml(
            'utf-8')
        if status == "SUCCESS":
            booking.setWebExKey(
                dom.getElementsByTagName("meet:meetingkey")
                [0].firstChild.toxml('utf-8'))
        else:
            booking._url = ""
            errorID = dom.getElementsByTagName(
                "serv:exceptionID")[0].firstChild.toxml('utf-8')
            errorReason = dom.getElementsByTagName(
                "serv:reason")[0].firstChild.toxml('utf-8')
            return WebExError(errorID, userMessage=errorReason)