Example #1
0
 def _setMailText(self):
     text = self.text
     if self.note:
         text = text + "Note: %s" % self.note
     if self.confSumary:
         #try:
         from MaKaC.common.output import outputGenerator
         from MaKaC.accessControl import AdminList, AccessWrapper
         import MaKaC.webinterface.urlHandlers as urlHandlers
         admin = AdminList().getInstance().getList()[0]
         aw = AccessWrapper()
         aw.setUser(admin)
         path = Config.getInstance().getStylesheetsDir()
         if os.path.exists("%s/text.xsl" % path):
             stylepath = "%s/text.xsl" % path
         outGen = outputGenerator(aw)
         vars = { \
                 "modifyURL": urlHandlers.UHConferenceModification.getURL( self.conf ), \
                 "sessionModifyURLGen": urlHandlers.UHSessionModification.getURL, \
                 "contribModifyURLGen": urlHandlers.UHContributionModification.getURL, \
                 "subContribModifyURLGen":  urlHandlers.UHSubContribModification.getURL, \
                 "materialURLGen": urlHandlers.UHMaterialDisplay.getURL, \
                 "resourceURLGen": urlHandlers.UHFileAccess.getURL }
         confText = outGen.getOutput(self.conf, stylepath, vars)
         text += "\n\n\n" + confText
     #except:
     #    text += "\n\n\nSorry could not embed text version of the agenda..."
     self.mail.setText(text)
Example #2
0
    def _getAnswer(self):
        sm = SyncManager.getDBInstance()

        avtypes = AgentTypeInspector.getAvailableTypes()

        if self._type not in avtypes:
            raise ServiceError('', 'Agent type %s is unknown' % self._type)

        typeClass = avtypes[self._type]
        access = AdminList().getInstance().getList()[0]

        sm.registerNewAgent(
            typeClass(self._id, self._name, self._description, 60, access,
                      **self._specificParams))