Esempio n. 1
0
class WebcastManager(Persistent):
    """Holds and manages general information about webcasts in the system
    """
    def __init__(self):
        self.channels = []
        #        self._requested_webcasts = []
        self._archived_webcasts = []
        self._forthcoming_webcasts = []
        self._managers = []
        self._webcastSynchronizationURL = ''  #used for automatic synchronization

    def getManagers(self):
        try:
            return self._managers
        except:
            self._managers = []
            return self._managers

    def addManager(self, av):
        if av not in self.getManagers():
            self._managers.append(av)
            self._p_changed = 1

    def removeManager(self, av):
        if av in self.getManagers():
            self._managers.remove(av)
            self._p_changed = 1

    def removeManagerById(self, managerId):
        for av in self.getManagers():
            if av.getId() == managerId:
                self._managers.remove(av)
                self._p_changed = 1
                return True
        else:
            return False

    def isManager(self, av):
        if av in self.getManagers():
            return True
        else:
            return False

    def getChannels(self):
        return self.channels

    def getChannel(self, name):
        for ch in self.channels:
            if ch.getName() == name:
                return ch
        return None


#    def addRequestedWebcast(self, event ):
#        if not self.getRequestedWebcast(event):
#            if event:
#                wc = Webcast(event)
#                self._requested_webcasts.append(wc)
#                self._p_changed=1
#
#    def getRequestedWebcast(self, event):
#        for wc in self._requested_webcasts:
#            if wc.getEvent() == event:
#                return wc
#        return None
#
#    def getRequestedWebcasts(self):
#        return self._requested_webcasts
#
#    def acceptRequestedWebcast(self, webcast):
#        for wc in self._requested_webcasts:
#            if wc == webcast:
#                self._requested_webcasts.remove(webcast)
#                if not self.getForthcomingWebcast(webcast.getEvent()):
#                    self._forthcoming_webcasts.append(webcast)
#                self._p_changed=1
#
#    def deleteRequestedWebcast(self, webcast):
#        for wc in self._requested_webcasts:
#            if wc == webcast:
#                self._requested_webcasts.remove(webcast)
#                self._p_changed=1

    def addForthcomingWebcast(self, event, audience=""):
        wc = self.getForthcomingWebcast(event)
        if not wc:
            if event:
                wc = Webcast(event, audience)
                self._forthcoming_webcasts.append(wc)
                self._p_changed = 1
                self.remoteSynchronize()
        else:
            wc.setAudience(audience)

    def delForthcomingWebcast(self, event):
        wc = self.getForthcomingWebcast(event)
        if wc and wc in self._forthcoming_webcasts:
            self._forthcoming_webcasts.remove(wc)
            self._p_changed = 1

    def getForthcomingWebcast(self, event):
        for wc in self._forthcoming_webcasts:
            if wc.getEvent() == event:
                return wc
        return None

    def getForthcomingWebcastById(self, id):
        for wc in self._forthcoming_webcasts:
            if wc.getId() == id:
                return wc
        return None

    def getWebcasts(self):
        return self.getArchivedWebcasts() + self.getForthcomingWebcasts()

    def getForthcomingWebcasts(self):
        return self._forthcoming_webcasts

    def archiveForthcomingWebcast(self, webcast):
        for wc in self._forthcoming_webcasts:
            if wc == webcast:
                self._forthcoming_webcasts.remove(webcast)
                if not self.getArchivedWebcast(webcast.getEvent()):
                    self._archived_webcasts.append(webcast)
                self._p_changed = 1
                self.remoteSynchronize()

    def archiveForthcomingWebcastById(self, id):
        for wc in self._forthcoming_webcasts:
            if wc.getId() == id:
                self._forthcoming_webcasts.remove(wc)
                if not self.getArchivedWebcast(wc.getEvent()):
                    self._archived_webcasts.append(wc)
                self._p_changed = 1
                self.remoteSynchronize()

    def unArchiveWebcastById(self, id):
        for wc in self._archived_webcasts:
            if wc.getId() == id:
                self._archived_webcasts.remove(wc)
                if not self.getForthcomingWebcast(wc.getEvent()):
                    self._forthcoming_webcasts.append(wc)
                self._p_changed = 1
                self.remoteSynchronize()

    def deleteForthcomingWebcast(self, webcast):
        for wc in self._forthcoming_webcasts:
            if wc == webcast:
                self._forthcoming_webcasts.remove(webcast)
                self._p_changed = 1
                self.remoteSynchronize()
                return True
        return False

    def deleteForthcomingWebcastById(self, id):
        for wc in self._forthcoming_webcasts:
            if wc.getId() == id:
                self._forthcoming_webcasts.remove(wc)
                self._p_changed = 1
                self.remoteSynchronize()
                return True
        return False

    def addArchivedWebcast(self, event):
        if not self.getArchivedWebcast(event):
            if event:
                wc = Webcast(event)
                self._archived_webcasts.append(wc)
                self._p_changed = 1
                self.remoteSynchronize()

    def getArchivedWebcast(self, event):
        for wc in self._archived_webcasts:
            if wc.getEvent() == event:
                return wc
        return None

    def getArchivedWebcasts(self):
        return self._archived_webcasts

    def deleteArchivedWebcast(self, webcast):
        for wc in self._archived_webcasts:
            if wc == webcast:
                self._archived_webcasts.remove(webcast)
                self._p_changed = 1
                return True
        return False

    def deleteArchivedWebcastById(self, id):
        for wc in self._archived_webcasts:
            if wc.getId() == id:
                self._archived_webcasts.remove(wc)
                self._p_changed = 1
                return True
        return False

    def setOnAir(self, chname, webcast):
        ch = self.getChannel(chname)
        if ch:
            ch.setOnAir(webcast)
            self.remoteSynchronize()

    def whatsOnAir(self):
        onair = []
        for ch in self.getChannels():
            if ch.whatsOnAir() != None:
                onair.append(ch.whatsOnAir())
        return onair

    def isOnAir(self, event):
        for ch in self.getChannels():
            if ch.whatsOnAir() != None:
                if ch.whatsOnAir().getId() == event.getId():
                    return ch.getURL()
        return None

    def removeFromAir(self, chname):
        ch = self.getChannel(chname)
        if ch:
            ch.setOnAir(None)
            self.remoteSynchronize()

    def addChannel(self, name, url, width=480, height=360):
        if name != "" and not self.getChannel(name):
            ch = Channel(name, url, width, height)
            self.channels.append(ch)
            self._p_changed = 1
            self.remoteSynchronize()

    def removeChannel(self, name):
        for ch in self.channels:
            if ch.getName() == name:
                self.channels.remove(ch)
                self._p_changed = 1
                self.remoteSynchronize()

    def switchChannel(self, name):
        for ch in self.channels:
            if ch.getName() == name:
                ch.switchOnAir()
                self._p_changed = 1
                self.remoteSynchronize()

    def moveChannelUp(self, nb):
        if len(self.channels) <= 1 or len(self.channels) < nb:
            return False
        tomove = self.channels.pop(nb)
        if nb == 0:
            self.channels.append(tomove)
        else:
            self.channels.insert(nb - 1, tomove)
        self._p_changed = 1
        self.remoteSynchronize()
        return True

    def moveChannelDown(self, nb):
        if len(self.channels) <= 1 or len(self.channels) < nb:
            return False
        tomove = self.channels.pop(nb)
        if nb == len(self.channels):
            self.channels.insert(0, tomove)
        else:
            self.channels.insert(nb + 1, tomove)
        self._p_changed = 1
        self.remoteSynchronize()
        return True

    def getWebcastServiceURL(self, wc):
        """ Returns the Webcast Service URL ( a string ).
            It will be used to display a link when an event is a forthcoming webcast.
        """
        if not wc:
            return None
        elif not wc.getAudience():
            return CollaborationTools.getOptionValue('WebcastRequest',
                                                     "webcastPublicURL")

        for row in CollaborationTools.getOptionValue('WebcastRequest',
                                                     "webcastAudiences"):
            if row['name'] == wc.getAudience():
                return row['structure']

        return ''

    def getWebcastSynchronizationURL(self):
        """ Returns the Webcast Synchronization URL ( a string ).
            It will be used to automatically synchronize every time a 'live channel' is modified
            or an event is added / removed from forthcoming webcasts
        """
        if not hasattr(self, "_webcastSynchronizationURL"):
            self._webcastSynchronizationURL = ''
        return self._webcastSynchronizationURL

    def setWebcastSynchronizationURL(self, url):
        """ Sets the Webcast Synchronization URL ( a string ).
        """
        self._webcastSynchronizationURL = url

    def remoteSynchronize(self, raiseExceptionOnSyncFail=False):
        """ Calls the webcast synchronization URL
            Will perform an intermediate commit before calling the URL
            or the remote server will query a non-updated state of the indico DB.

            raiseExceptionOnSyncFail: if True (default), we will raise a MaKaCError if calling the webcast
            synchronization URL had a problem
        """
        url = str(self.getWebcastSynchronizationURL()).strip()
        if url:

            try:
                Logger.get('webcast').info("Doing an intermediate commit...")
                DBMgr.getInstance().commit()
                Logger.get('webcast').info("Commit done.")
                Logger.get('webcast').info(
                    "Calling the webcast synchronization URL: " + url)
                answer = urlopen(url, timeout=10).read(100000).strip()
                Logger.get('webcast').info("Got answer: " + answer)
                return answer

            except HTTPError, e:
                code = e.code
                shortMessage = BaseHTTPRequestHandler.responses[code][0]
                longMessage = BaseHTTPRequestHandler.responses[code][1]

                Logger.get('webcast').error(
                    """Calling the webcast synchronization URL: [%s] triggered HTTPError: %s (code = %s, shortMessage = '%s', longMessage = '%s'"""
                    % (str(url), str(e), code, shortMessage, longMessage))

                if raiseExceptionOnSyncFail:
                    if str(code) == '404':
                        raise MaKaCError(
                            'Could not find the server at ' + str(url) +
                            "(HTTP error 404)", 'webcast')
                    elif str(code) == '500':
                        raise MaKaCError(
                            "The server at" + str(url) +
                            " has an internal problem (HTTP error 500)",
                            'webcast')
                    else:
                        raise MaKaCError(
                            "Problem contacting the webcast synchronization server. Reason: HTTPError: %s (code = %s, shortMessage = '%s', longMessage = '%s', url = '%s'"
                            "" % (str(e), code, shortMessage, longMessage,
                                  str(url)), 'webcast')

            except URLError, e:
                Logger.get('webcast').error(
                    """Calling the webcast synchronization URL: [%s] triggered exception: %s"""
                    % (str(url), str(e)))
                if raiseExceptionOnSyncFail:
                    if str(e.reason).strip() == 'timed out':
                        raise MaKaCError(
                            "The webcast synchronization URL is not responding",
                            'webcast')
                    raise MaKaCError(
                        """URLError when contacting the webcast synchronization URL: [%s]. Reason=[%s]"""
                        % (str(url), str(e.reason)), 'webcast')

            except ValueError, e:
                Logger.get('webcast').error(
                    """Calling the webcast synchronization URL: [%s] triggered ValueError: %s"""
                    % (str(url), str(e)))
                if raiseExceptionOnSyncFail:
                    if str(e.args[0]).strip().startswith("unknown url type"):
                        raise MaKaCError(
                            "The webcast synchronization is not of a correct type. Perhaps you forgot the http:// ?",
                            'webcast')
                    raise MaKaCError(
                        """Calling the webcast synchronization URL: [%s] triggered ValueError: %s"""
                        % (str(url), str(e)), 'webcast')
Esempio n. 2
0
 def _checkProtection(self):
     RHTrackModifBase._checkProtection(self)
     if not self._conf.hasEnabledSection("cfa"):
         raise MaKaCError( _("You cannot access this option because \"Abstracts\" was disabled"))
Esempio n. 3
0
 def create(cls, entryId, title, location, startDate, materials, authors, description):
     raise MaKaCError(_("Method create was not overriden by the search engine."))
Esempio n. 4
0
 def _checkParams(self, params):
     RHAdminPluginsBase._checkParams(self, params)
     if self._pluginType is None:
         raise MaKaCError(_("pluginType not set"))
Esempio n. 5
0
 def _checkProtection(self):
     RHTrackAbstractBase._checkProtection(self)
     if  not self._abstract.getConference().getConfAbstractReview().canReviewerAccept():
         raise MaKaCError(_("The acceptance or rejection of abstracts is not allowed. Only the managers of the conference can perform this action."))
Esempio n. 6
0
 def _checkParams(self, params):
     RHContribModifBase._checkParams(self, params)
     if self._target.getReviewManager().getLastReview().getRefereeJudgement().isSubmitted():
         raise MaKaCError("The content assessment has been submitted")
Esempio n. 7
0
 def _checkProtection(self):
     if self._target.getConference().hasEnabledSection("paperReviewing"):
         if not RCPaperReviewManager.hasRights(self):
             RHContribModifBase._checkProtection(self);
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Esempio n. 8
0
 def _process(self):
     logo = self._target.getLogo()
     if not logo:
         raise MaKaCError(_("This event does not have a logo"))
     return send_file(logo.getFileName(), logo.getFilePath(), logo.getFileType(), no_cache=False, conditional=True)
Esempio n. 9
0
 def _checkProtection(self):
     RHConferenceBaseDisplay._checkProtection(self)
     if not self._conf.getAbstractMgr().isActive() or not self._conf.hasEnabledSection("cfa"):
         raise MaKaCError( _("The Call For Abstracts was disabled by the conference managers"))
Esempio n. 10
0
 def _process_DELETE(self):
     if self._field.isLocked('delete'):
         raise MaKaCError(_("Deleted action couldn't be perform"))
     self._section.removeField(self._field)
     return json.dumps(self._section.fossilize())
Esempio n. 11
0
 def setLocationName(self, locationName):
     if self.__class__.__name__ == 'RoomBase':
         raise MaKaCError(
             'This method is purely virtual. Call it only on derived objects.'
         )
     return self.setLocationName(locationName)  # Subclass
Esempio n. 12
0
 def _checkParams(self, params):
     RHTrackModifBase._checkParams(self, params)
     absId = params.get("abstractId", "").strip()
     if absId == "":
         raise MaKaCError(_("Abstract identifier not specified"))
     self._abstract = self._track.getAbstractById(absId)
Esempio n. 13
0
 def _checkParams(self, params):
     if "userId" not in params or params["userId"].strip() == "":
         raise MaKaCError(_("user id not specified"))
     ah = user.AvatarHolder()
     self._target = self._avatar = ah.getById(params["userId"])
Esempio n. 14
0
 def _checkParams(self, params):
     admins.RHAdminBase._checkParams(self, params)
     if "groupId" not in params or params["groupId"].strip() == "":
         raise MaKaCError(_("group id not specified"))
     gh = user.GroupHolder()
     self._target = self._group = gh.getById(params["groupId"])
Esempio n. 15
0
 def _checkProtection(self):
     RHContributionDisplay._checkProtection(self)
     if not self._contrib.canUserSubmit(self._aw.getUser()):
         raise MaKaCError(
             _("you are not authorised to manage material for this contribution"
               ))
Esempio n. 16
0
 def _checkParams(self, params):
     RHManageContributionReviewingBase._checkParams(self, params)
     paper_review = self._conf.getReviewManager(self.contrib)
     if paper_review.getLastReview().getRefereeJudgement().isSubmitted() and \
        not paper_review.getChoice() == CPR.LAYOUT_REVIEWING:
         raise MaKaCError("The editor assessment has been submitted")
Esempio n. 17
0
 def _checkParams(self, params):
     RHContribModifBase._checkParams(self, params)
     if self._target.getReviewManager().getLastReview().getRefereeJudgement().isSubmitted() and \
        not self._target.getConference().getConfPaperReview().getChoice() == CPR.LAYOUT_REVIEWING:
         raise MaKaCError("The editor assessment has been submitted")
Esempio n. 18
0
 def _checkParams(self, params):
     RHManageContributionReviewingBase._checkParams(self, params)
     paper_review = self._conf.getReviewManager(self.contrib)
     if paper_review.getLastReview().getRefereeJudgement().isSubmitted():
         raise MaKaCError("The content assessment has been submitted")
Esempio n. 19
0
 def _checkProtection(self):
     if self._target.getConference().hasEnabledSection("paperReviewing"):
         RHAssignEditorOrReviewerBase._checkProtection(self)
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Esempio n. 20
0
 def setDetailLevel(self, newDL):
     newDL = newDL.strip().lower()
     if not (newDL in self.getAllowedDetailLevels()):
         raise MaKaCError(_("imposible to set this detail level"))
     self._detailLevel = newDL
Esempio n. 21
0
        if self.getCSRFLevel() not in range(4):
            raise MaKaCError("Invalid CSRFLevel value (%s). Valid values: 0, 1, 2, 3" % (self._configVars['CSRFLevel']))

        if self.getRedisConnectionURL():
            # Rest if redis is available and if we can connect
            try:
                import redis
                redis.StrictRedis.from_url(self.getRedisConnectionURL())
                # a redis ping here would be nice but we do not have a working logger yet
            except ImportError, e:
                raise MaKaCError('Could not import redis: %s' % e.message)

        else:
            if self.getCacheBackend() == 'redis':
                raise MaKaCError('Cannot use redis CacheBackend with no RedisConnectionURL')

        if self.getStaticFileMethod() is not None and len(self.getStaticFileMethod()) != 2:
            raise MaKaCError('StaticFileMethod must be None, a string or a 2-tuple')

        if self.getDefaultTimezone() not in pytz.all_timezones_set:
            raise ValueError('Invalid default timezone: {}'.format(self.getDefaultTimezone()))

        if self.getAttachmentStorage() not in self.getStorageBackends():
            raise ValueError('Attachment storage "{}" is not defined in storage backends'.format(
                self.getAttachmentStorage()))

    def __getattr__(self, attr):
        """Dynamic finder for values defined in indico.conf

            For example, if an indico.conf value is "username" this method will
Esempio n. 22
0
 def _process(self):
     if self._cannotViewTab:
         raise MaKaCError(_("That Video Services tab doesn't exist"), _("Video Services"))
     else:
         p = WPElectronicAgreement(self, self._conf)
         return p.display(sortCriteria = self.sortCriteria, order = self.order)
Esempio n. 23
0
 def _checkProtection( self ):
     conferenceModif.RHConferenceModifBase._checkProtection(self)
     if not self._conf.hasEnabledSection("regForm"):
         raise MaKaCError( _("The registrants' management was disabled by the conference managers"))
Esempio n. 24
0
 def _importedXml(self, evaluation, params):
     """ Importation of an evaluation.
         Note: original 'isVisible' and the dates are kept.
     """
     try:
         xmlString = params["xmlFile"].file.read()
     except AttributeError:  #no file given
         self._redirect(
             urlHandlers.UHConfModifEvaluationSetup.getURL(self._conf))
         return
     try:
         doc = parseString(xmlString)
     except:
         raise MaKaCError(
             _("""System can't import an evaluation from your file.
                             Be sure to import the right XML file."""),
             _("evaluation"))
     #parse begins
     evalNode = self._getElement(doc, "evaluation")
     if params.get("configOption", "") == "imported":
         #parse node /evaluation/
         title = self._getValue(evalNode, "title")
         announcement = self._getValue(evalNode, "announcement")
         submissionsLimit = self._getValue(evalNode, "submissionsLimit")
         contactInfo = self._getValue(evalNode, "contactInfo")
         mandatoryAccount = self._getValue(evalNode, "mandatoryAccount")
         mandatoryParticipant = self._getValue(evalNode,
                                               "mandatoryParticipant")
         anonymous = self._getValue(evalNode, "anonymous")
         evaluation.setTitle(title)
         evaluation.setAnnouncement(announcement)
         evaluation.setSubmissionsLimit(submissionsLimit)
         evaluation.setContactInfo(contactInfo)
         evaluation.setMandatoryAccount(mandatoryAccount)
         evaluation.setMandatoryParticipant(mandatoryParticipant)
         if anonymous.strip() == "":
             evaluation.setAnonymous(True)
         else:
             evaluation.setAnonymous(anonymous)
         #parse node /evaluation/notifications/
         notificationsNode = self._getElement(evalNode, "notifications")
         evaluation.removeAllNotifications()
         for notificationNode in notificationsNode.childNodes:
             if isinstance(notificationNode, Element):
                 from MaKaC.registration import Notification
                 notification = Notification()
                 toList = self._getValue(notificationNode, "toList")
                 ccList = self._getValue(notificationNode, "ccList")
                 notification.setToList(utils.getEmailList(toList))
                 notification.setCCList(utils.getEmailList(ccList))
                 evaluation.setNotification(notificationNode.tagName,
                                            notification)
     if params.get("questionsOption",
                   "") != "current":  # in ["imported", "both"]
         if params.get("questionsOption", "") == "imported":
             evaluation.removeAllQuestions()
         #parse node /evaluation/questions/
         questionsNode = self._getElement(evalNode, "questions")
         for questionNode in questionsNode.childNodes:
             if isinstance(questionNode, Element):
                 questionValue = self._getValue(questionNode,
                                                "questionValue")
                 keyword = self._getValue(questionNode, "keyword")
                 required = self._getValue(questionNode, "required")
                 description = self._getValue(questionNode, "description")
                 help = self._getValue(questionNode, "help")
                 try:
                     question = eval(questionNode.tagName)()
                     if isinstance(question, Question):
                         question.setQuestionValue(questionValue)
                         question.setKeyword(keyword)
                         question.setRequired(required)
                         question.setDescription(description)
                         question.setHelp(help)
                         evaluation.insertQuestion(question)
                 except NameError:
                     raise MaKaCError(
                         _("""xml parse error: unknown question type "%s"
                                         """) % questionNode.tagName,
                         _("evaluation"))
                 if isinstance(question, Box):
                     defaultAnswer = self._getValue(questionNode,
                                                    "defaultAnswer")
                     question.setDefaultAnswer(defaultAnswer)
                 elif isinstance(question, Choice):
                     #parse node /evaluation/questions/*/choiceItems/
                     choiceItemsNode = self._getElement(
                         questionNode, "choiceItems")
                     for choiceItemNode in choiceItemsNode.childNodes:
                         if isinstance(choiceItemNode, Element):
                             itemText = self._getValue(
                                 choiceItemNode, "itemText")
                             if itemText.strip() != "":
                                 isSelected = self._getValue(
                                     choiceItemNode, "isSelected")
                                 question.insertChoiceItem(
                                     itemText, isSelected)
Esempio n. 25
0
 def _checkParams(self,params):
     RHTrackAbstractBase._checkParams(self,params)
     id=params.get("intCommentId","")
     if id=="":
         raise MaKaCError( _("the internal comment identifier hasn't been specified"))
     self._comment=self._abstract.getIntCommentById(id)
Esempio n. 26
0
 def _checkProtection(self):
     conferenceModif.RHConferenceModifBase._checkProtection(self)
     if not self._conf.hasEnabledSection("evaluation"):
         raise MaKaCError(
             _("The Evaluation form was disabled by the conference managers."
               ), _("evaluation"))
Esempio n. 27
0
     John Harvey

     Chair Programme Committee
     """

log = open('./email.log', 'w')
logErrors = open('./emailErrors.log', 'w')
server = smtplib.SMTP(Config.getInstance().getSmtpServer())
if Config.getInstance().getSmtpUseTLS():
    server.ehlo()
    (code, errormsg) = server.starttls()
    if code != 220:
        from MaKaC.errors import MaKaCError
        raise MaKaCError(
            "Can't start secure connection to SMTP server: %d, %s" %
            (code, errormsg))
if Config.getInstance().getSmtpLogin():
    login = Config.getInstance().getSmtpLogin()
    password = Config.getInstance().getSmtpPassword()
    (code, errormsg) = server.login(login, password)
    if code != 235:
        from MaKaC.errors import MaKaCError
        raise MaKaCError("Can't login on SMTP server: %d, %s" %
                         (code, errormsg))
for to in toList:
    cc = ""
    msg = "From: %s\r\nTo: %s\r\n%sSubject: %s\r\n\r\n%s" % (fromAddr, to, cc,
                                                             subject, body)
    try:
        server.sendmail(fromAddr, [to], msg)
Esempio n. 28
0
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         RHConferenceBaseDisplay._checkProtection(self)
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Esempio n. 29
0
 def process(self, filteredParams):
     raise MaKaCError("Method process was not overriden for the search engine " + str(self._id))
Esempio n. 30
0
    def _displayMonth(self):
        id = self._id
        type = self._type
        month = self._month
        year = self._year
        today = date.today()
        res = []

        url = urlHandlers.UHGetCalendarOverview.getURL()
        url.addParam("selCateg", id)
        url.addParam("period", type)

        nextMonth = urlHandlers.UHGetCalendarOverview.getURL()
        previousMonth = urlHandlers.UHGetCalendarOverview.getURL()
        nextYear = urlHandlers.UHGetCalendarOverview.getURL()
        previousYear = urlHandlers.UHGetCalendarOverview.getURL()

        nextMonth.addParam("selCateg", id)
        previousMonth.addParam("selCateg", id)
        nextYear.addParam("selCateg", id)
        previousYear.addParam("selCateg", id)

        nextMonth.addParam("period", type)
        previousMonth.addParam("period", type)
        nextYear.addParam("period", type)
        previousYear.addParam("period", type)

        for day in range(1, calendar.monthrange(year, month)[1] + 1):
            if day == 1:
                for i in range(calendar.weekday(year, month, day)):
                    res.append("<td></td>")
            if calendar.weekday(year, month, day) in (5, 6):
                bgcolor = "#e0cdcd"
            else:
                bgcolor = "#FFFFFF"
            if self._date != []:
                #for highlight multiple dates
                for date2 in self._date:
                    (d, m, y) = date2.split("-")

                    try:
                        if date(year, month,
                                day) == date(int(y), int(m), int(d)):
                            bgcolor = "#ffcccc"
                    except Exception, e:
                        raise MaKaCError(
                            "%s-%s-%s------%s-%s-%s\nself._date:%s\ndate2:%s" %
                            (year, month, day, y, m, d, self._date, date2))

                    url.addParam("day", day)
                    url.addParam("month", month)
                    url.addParam("year", year)
                    strUrl = "%s" % url

            if date(year, month, day) == today:
                bgcolor = "#ccffcc"

            res.append(
                """<td align="right" bgcolor="%s"><a href="%s">%s</a></td>""" %
                (bgcolor, strUrl, day))

            if calendar.weekday(year, month, day) == 6:
                res.append("</tr><tr>")