Пример #1
0
    def send(cls, notification, skipQueue=False):
        if isinstance(notification, dict):
            # Wrap a raw dictionary in a notification class
            from MaKaC.webinterface.mail import GenericNotification
            notification = GenericNotification(notification)
        # enqueue emails if we have a rh and do not skip queuing, otherwise send immediately
        rh = ContextManager.get('currentRH', None)
        mailData = cls._prepare(notification)

        if mailData:
            if skipQueue or not rh:
                cls._send(mailData)
            else:
                ContextManager.setdefault('emailQueue', []).append(mailData)
Пример #2
0
    def send(cls, notification, skipQueue=False):
        if isinstance(notification, dict):
            # Wrap a raw dictionary in a notification class
            from MaKaC.webinterface.mail import GenericNotification
            notification = GenericNotification(notification)
        # enqueue emails if we have a rh and do not skip queuing, otherwise send immediately
        rh = ContextManager.get('currentRH', None)
        mailData = cls._prepare(notification)

        if mailData:
            if skipQueue or not rh:
                cls._send(mailData)
            else:
                ContextManager.setdefault('emailQueue', []).append(mailData)
Пример #3
0
    def cloneEvent(cls, confToClone, params):
        """ we'll clone only the chat rooms created by the user who is cloning the conference """
        conf = params['conf']
        user = params['user']
        options = params['options']
        ContextManager.setdefault('mailHelper', MailHelper())

        if options.get("chatrooms", True):
            crList = DBHelpers().getChatroomList(confToClone)
            ownersList = [cr.getOwner() for cr in crList]
            if PluginsWrapper('InstantMessaging', 'XMPP').isActive():
                 for cr in crList:
                     if user is cr.getOwner():
                         cls()._notify('addConference2Room', {'room':cr, 'conf':conf.getId()})

        ContextManager.get('mailHelper').sendMails()
Пример #4
0
    def _handleSet(self):

        # Account for possible retries (due to conflicts)
        # If 'minutesFileId' is defined, there was a previous try
        fileId = ContextManager.setdefault("minutesFileId", None)

        minutes = self._target.getMinutes()
        if not minutes:
            minutes = self._target.createMinutes()
        minutes.setText(self._text, forcedFileId=fileId)

        # save the fileId, in case there is a conflict error
        # in the worst case scenario the file will be rewritten multiple times
        res = minutes.getResourceById("minutes")
        ContextManager.set("minutesFileId", res.getRepositoryId())
Пример #5
0
    def _handleSet(self):

        # Account for possible retries (due to conflicts)
        # If 'minutesFileId' is defined, there was a previous try
        fileId = ContextManager.setdefault('minutesFileId', None)

        minutes = self._target.getMinutes()
        if not minutes:
            minutes = self._target.createMinutes()
        minutes.setText(self._text, forcedFileId=fileId)

        # save the fileId, in case there is a conflict error
        # in the worst case scenario the file will be rewritten multiple times
        res = minutes.getResourceById('minutes')
        ContextManager.set('minutesFileId', res.getRepositoryId())
 def _getStorage(cls):
     """ Returns the dictionary where the results are stored.
         The dictionary is stored inside the ContentManager
     """
     return ContextManager.setdefault("collaborationRemoteOperations", {})
Пример #7
0
 def _getStorage(cls):
     """ Returns the dictionary where the results are stored.
         The dictionary is stored inside the ContentManager
     """
     return ContextManager.setdefault("collaborationRemoteOperations", {})