Beispiel #1
0
 def _deleteTask(self, taskId):
     task = HelperTaskList.getTaskListInstance().getTaskById(taskId)
     
     if isinstance(task, Alarm):
         task.conf.removeAlarm(task)
         return
     else:
         if type(task.getObjList()[0]) == PendingSubmitterReminder: 
             for obj in task.getObjList():
                 for pend in obj.getPendings():
                     cpqm = pend.getConference().getPendingQueuesMgr()
                     cpqm.removePendingSubmitter(pend)
                 task.removeObj(obj)
             return
         elif type(task.getObjList()[0]) == PendingManagerReminder:
             for obj in task.getObjList():
                 for pend in obj.getPendings():
                     cpqm = pend.getConference().getPendingQueuesMgr()
                     cpqm.removePendingManager(pend)
                 task.removeObj(obj)
             return
         elif type(task.getObjList()[0]) == PendingCoordinatorReminder:
             for obj in task.getObjList():
                 for pend in obj.getPendings():
                     cpqm = pend.getConference().getPendingQueuesMgr()
                     cpqm.removePendingCoordinator(pend)
                 task.removeObj(obj)
             return
Beispiel #2
0
    def _deleteTask(self, taskId):
        task = HelperTaskList.getTaskListInstance().getTaskById(taskId)

        if isinstance(task, Alarm):
            task.conf.removeAlarm(task)
            return
        else:
            if type(task.getObjList()[0]) == PendingSubmitterReminder:
                for obj in task.getObjList():
                    for pend in obj.getPendings():
                        cpqm = pend.getConference().getPendingQueuesMgr()
                        cpqm.removePendingSubmitter(pend)
                    task.removeObj(obj)
                return
            elif type(task.getObjList()[0]) == PendingManagerReminder:
                for obj in task.getObjList():
                    for pend in obj.getPendings():
                        cpqm = pend.getConference().getPendingQueuesMgr()
                        cpqm.removePendingManager(pend)
                    task.removeObj(obj)
                return
            elif type(task.getObjList()[0]) == PendingCoordinatorReminder:
                for obj in task.getObjList():
                    for pend in obj.getPendings():
                        cpqm = pend.getConference().getPendingQueuesMgr()
                        cpqm.removePendingCoordinator(pend)
                    task.removeObj(obj)
                return
Beispiel #3
0
    def create(self):
        # Create a wrapper for the RH
        rhw = RHWrapper(self._rh)
        # Instantiate a dvd creator
        if self._wf is None:
            dvdCreator = ConferenceOfflineCreator(rhw, self._conf)
        else:
            dvdCreator = MeetingOfflineCreator(rhw, self._conf)
        dvdCreator.setId("OffLineWebsiteCreator")
        
        # Create a task for the DVD Creator
        dvdTask = task()
        dvdTask.addObj(dvdCreator)

        # Add the track to the track list
        htl = HelperTaskList.getTaskListInstance()
        htl.addTask(dvdTask)
Beispiel #4
0
    def create(self):
        # Create a wrapper for the RH
        rhw = RHWrapper(self._rh)
        # Instantiate a dvd creator
        if self._wf is None:
            dvdCreator = ConferenceOfflineCreator(rhw, self._conf)
        else:
            dvdCreator = MeetingOfflineCreator(rhw, self._conf)
        dvdCreator.setId("OffLineWebsiteCreator")

        # Create a task for the DVD Creator
        dvdTask = task()
        dvdTask.addObj(dvdCreator)

        # Add the task to the task list
        htl = HelperTaskList.getTaskListInstance()
        htl.addTask(dvdTask)
Beispiel #5
0
 def _addTask(self, email):
     """Creating a task in order to send reminder emails periodically.
        It's mandatory to implement this method for the specific pending queues"""
     # ------ Creating a task in order to send reminder emails periodically ------
     if not self._hasTask(email):
         # Create the object which send the email
         pedingReminder=self._reminder(email)
         pedingReminder.setId("ReminderPending%s-%s"%(self._id,email))
         # Create the task
         t=task()
         t.addObj(pedingReminder) 
         t.setInterval(timedelta(7)) # Remind each 7 days
         nw=nowutc()
         t.setLastDate(nw) # start in 7 days cos the first email was already sent
         t.setEndDate(nw+timedelta(15)) # keep trying during 15 days
         self._tasksIdx.indexTask(email, t)
         # Add the track to the track list
         htl = HelperTaskList.getTaskListInstance()
         htl.addTask(t)
Beispiel #6
0
 def _removeTask(self, email):
     if self._hasTask(email):
         t=self._getTasksIdx().matchTask(email)[0]
         htl = HelperTaskList.getTaskListInstance()
         htl.removeTask(t)
         self._tasksIdx.unindexTask(email, t)
Beispiel #7
0
    from pytz import timezone
    try:
        from MaKaC.conference import CategoryManager
        from MaKaC.common import DBMgr
        from MaKaC.common.timerExec import HelperTaskList, StatisticsUpdater, task
        from MaKaC.common.timezoneUtils import nowutc
    except ImportError, e:
        print "ImportError:%s"%e
        sys.exit(0)


    print "\nTrying to connect with the database...\nIf you don't see any following message, please make sure that you have already started the database because you might have a connection problem with it.\n"
    DBMgr.getInstance().startRequest()
    print "Database connection established."
    # ------------------------ STATISTICS ------------------------
    tl = HelperTaskList.getTaskListInstance()
    catRoot = CategoryManager().getRoot()
    try:
        if catRoot.statsUpdater != None:
            tl.removeTask(catRoot.statsUpdater)
            catRoot.statsUpdater = None
    except:
        catRoot.statsUpdater = None
    su = StatisticsUpdater(catRoot)
    su.setId("StatisticsUpdater")
    ta = task()
    d = nowutc() + timedelta(days=1)
    ta.setStartDate(datetime(d.year, d.month, d.day, 0, 0, tzinfo=timezone('UTC')))
    ta.setInterval(timedelta(days=1))
    ta.addObj(su)
    tl.addTask(ta)
Beispiel #8
0
    from datetime import timedelta, datetime
    from pytz import timezone
    try:
        from MaKaC.conference import CategoryManager
        from MaKaC.common import DBMgr
        from MaKaC.common.timerExec import HelperTaskList, StatisticsUpdater, task
        from MaKaC.common.timezoneUtils import nowutc
    except ImportError, e:
        print "ImportError:%s" % e
        sys.exit(0)

    print "\nTrying to connect with the database...\nIf you don't see any following message, please make sure that you have already started the database because you might have a connection problem with it.\n"
    DBMgr.getInstance().startRequest()
    print "Database connection established."
    # ------------------------ STATISTICS ------------------------
    tl = HelperTaskList.getTaskListInstance()
    catRoot = CategoryManager().getRoot()
    try:
        if catRoot.statsUpdater != None:
            tl.removeTask(catRoot.statsUpdater)
            catRoot.statsUpdater = None
    except:
        catRoot.statsUpdater = None
    su = StatisticsUpdater(catRoot)
    su.setId("StatisticsUpdater")
    ta = task()
    d = nowutc() + timedelta(days=1)
    ta.setStartDate(
        datetime(d.year, d.month, d.day, 0, 0, tzinfo=timezone('UTC')))
    ta.setInterval(timedelta(days=1))
    ta.addObj(su)