Changeset 010517 in indico
- Timestamp:
- 01/26/11 18:37:45 (2 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 5bcab3
- Parents:
- e952fe
- git-author:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/26/11 09:17:14)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/26/11 18:37:45)
- Location:
- indico
- Files:
-
- 1 added
- 16 edited
- 3 moved
-
MaKaC/plugins/InstantMessaging/XMPP/components.py (modified) (6 diffs)
-
MaKaC/plugins/InstantMessaging/XMPP/handlers.py (modified) (9 diffs)
-
MaKaC/plugins/InstantMessaging/XMPP/helpers.py (modified) (2 diffs)
-
MaKaC/plugins/InstantMessaging/XMPP/options.py (modified) (1 diff)
-
MaKaC/plugins/InstantMessaging/chatroom.py (modified) (3 diffs)
-
MaKaC/plugins/InstantMessaging/htdocs/im.css (added)
-
MaKaC/plugins/InstantMessaging/htdocs/js/InstantMessaging.js (moved) (moved from indico/htdocs/js/indico/Plugins/InstantMessaging.js)
-
MaKaC/plugins/InstantMessaging/indexes.py (modified) (7 diffs)
-
MaKaC/plugins/InstantMessaging/pages.py (modified) (9 diffs)
-
MaKaC/plugins/InstantMessaging/rh.py (modified) (1 diff)
-
MaKaC/plugins/InstantMessaging/tpls/ConfModifChat.tpl (moved) (moved from indico/MaKaC/webinterface/tpls/ConfModifChat.tpl)
-
MaKaC/plugins/InstantMessaging/tpls/ConferenceInstantMessaging.tpl (moved) (moved from indico/MaKaC/webinterface/tpls/ConferenceInstantMessaging.tpl) (2 diffs)
-
MaKaC/plugins/base.py (modified) (2 diffs)
-
MaKaC/plugins/helpers.py (modified) (2 diffs)
-
MaKaC/webinterface/pages/base.py (modified) (1 diff)
-
MaKaC/webinterface/pages/conferences.py (modified) (4 diffs)
-
MaKaC/webinterface/wcomponents.py (modified) (1 diff)
-
core/api/conference.py (modified) (2 diffs)
-
ext/livesync/chrome.py (modified) (2 diffs)
-
htdocs/css/Default.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/plugins/InstantMessaging/XMPP/components.py
rb8c483 r010517 94 94 out.writeTag("server", 'conference.' + chatroom.getHost() if chatroom.getCreatedInLocalServer() else chatroom.getHost()) 95 95 out.writeTag("description", chatroom.getDescription()) 96 out.writeTag("reqPassword", _('Yes') if len(chatroom.getPassword()) > 0else _('No'))96 out.writeTag("reqPassword", _('Yes') if chatroom.getPassword() else _('No')) 97 97 out.writeTag("showPassword", chatroom.getShowPass()) 98 98 out.writeTag("password", chatroom.getPassword()) … … 169 169 room = params['room'] 170 170 171 conference = room.getConference()171 conference = params['conference'] 172 172 173 173 # index by conference id 174 confIndex = IndexByConf( conference.getId())174 confIndex = IndexByConf() 175 175 room.setId(DBHelpers.newID()) 176 confIndex.index( room)176 confIndex.index(conference.getId(), room) 177 177 178 178 # Index by chat room's name 179 crNameIndex = IndexByCRName( room.getTitle())179 crNameIndex = IndexByCRName() 180 180 crNameIndex.index(room) 181 181 … … 185 185 186 186 # Index by room creator 187 userIndex = IndexByUser( room.getOwner().getId())188 userIndex.index(room )187 userIndex = IndexByUser() 188 userIndex.index(room.getOwner().getId(), room) 189 189 190 190 @classmethod … … 195 195 if oldTitle != newRoom.getTitle(): 196 196 #the title has been changed. Get rid of the old index and substitute it for the new one 197 crNameIndex = IndexByCRName( newRoom.getTitle())197 crNameIndex = IndexByCRName() 198 198 crNameIndex.unindex(newRoom, oldTitle) 199 crNameIndex.index(newRoom )199 crNameIndex.index(newRoom.getTitle(), newRoom) 200 200 201 201 @classmethod 202 202 def deleteChatroom(cls, obj, params): 203 203 """ Deletes the chat room in the database according to all kind of indexing types""" 204 try: 205 chatroom = params['room'] 206 207 confId = obj._conferenceID 208 #if we have the same room used in two or more different conferences, we just delete it from the 209 #conferences list in the chat room and from the IndexByConf index 210 chatroom.getConferences().pop(confId) 211 confIndex = IndexByConf(confId) 212 confIndex.unindex(chatroom) 213 214 if len(chatroom.getConferences()) is 0: 215 #there are no more references to the chat room, we completely delete it 216 crNameIndex = IndexByCRName(chatroom.getTitle()) 217 crNameIndex.unindex(chatroom) 218 219 idIndex = IndexByID() 220 idIndex.unindex(chatroom) 221 222 userIndex = IndexByUser(chatroom.getOwner().getId()) 223 userIndex.unindex(chatroom) 224 225 except Exception, e: 226 raise ServiceError(message=str(e)) 204 205 chatroom = params['room'] 206 207 confId = obj._conferenceID 208 #if we have the same room used in two or more different conferences, we just delete it from the 209 #conferences list in the chat room and from the IndexByConf index 210 chatroom.getConferences().pop(confId) 211 confIndex = IndexByConf() 212 confIndex.unindex(confId, chatroom) 213 214 if len(chatroom.getConferences()) is 0: 215 #there are no more references to the chat room, we completely delete it 216 crNameIndex = IndexByCRName() 217 crNameIndex.unindex(chatroom) 218 219 idIndex = IndexByID() 220 idIndex.unindex(chatroom) 221 222 userIndex = IndexByUser() 223 userIndex.unindex(chatroom.getOwner().getId(), chatroom) 227 224 228 225 @classmethod … … 234 231 confId = params['conf'] 235 232 236 try: 237 confIndex = IndexByConf(confId) 238 confIndex.index(room) 239 240 except Exception, e: 241 raise NoReportError( _('The chat room %s could not be re-used' %room.getTitle())) 233 confIndex = IndexByConf() 234 confIndex.index(confId, room) 242 235 243 236 … … 254 247 # saying that a chat room was created. We pass the 2 mandatory arguments and finally the arguments required for performOperation 255 248 # (in this case, only one argument) 256 ExternalOperationsManager.execute(cls, "create_"+str(cls.__class__)+str(room.getId()), cls.performOperation, 'create', room.getConference (), room, room)249 ExternalOperationsManager.execute(cls, "create_"+str(cls.__class__)+str(room.getId()), cls.performOperation, 'create', room.getConferences().values()[0], room, room) 257 250 258 251 @classmethod -
indico/MaKaC/plugins/InstantMessaging/XMPP/handlers.py
rb8c483 r010517 161 161 162 162 def _getAnswer( self ): 163 conference = ConferenceHolder().getById(self._conferenceID) 163 164 self._room = XMPPChatroom(self._title, \ 164 165 self._user, \ 165 ConferenceHolder().getById(self._conferenceID), \166 conference, \ 166 167 None, \ 167 168 self._description, \ … … 176 177 try: 177 178 ContextManager.getdefault('mailHelper', MailHelper()) 178 self._notify('createChatroom', {'room': self._room}) 179 self._notify('createChatroom', {'room': self._room, 180 'conference': conference}) 179 181 except ServiceError, e: 180 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Exception while notifying observers: %s" %e)182 Logger.get('ext.im').error("Exception while notifying observers: %s" %e) 181 183 raise ServiceError( message=self.messages['sameId']+e ) 182 184 except NoReportError, e: 183 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Room exists: %s" %e)185 Logger.get('ext.im').error("Room exists: %s" %e) 184 186 raise NoReportError(self.messages['sameName'], explanation='roomExists') 185 187 except Exception, e: 186 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Weird exception while notifying observers: %s" %e)188 Logger.get('ext.im').error("Weird exception while notifying observers: %s" %e) 187 189 raise ServiceError( message=str(e) ) 188 190 if self._room.getCreatedInLocalServer(): … … 190 192 self.createRoomXMPP(self._botJID, self._botPass, self._room) 191 193 192 Logger.get(' InstantMessaging (XMPP-Indico server)').info("The room %s has been created by the user %s at %s hours" %(self._title, self._user.getName(), self._room.getModificationDate()))193 194 tz = DisplayTZ(self._aw, self._room.getConference()).getDisplayTZ()194 Logger.get('ext.im').info("The room %s has been created by the user %s at %s hours" %(self._title, self._user.getName(), self._room.getModificationDate())) 195 196 tz = DisplayTZ(self._aw, conference).getDisplayTZ() 195 197 196 198 ContextManager.get('mailHelper').sendMails() 197 199 fossilizedRoom = self._room.fossilize(tz=tz) 200 198 201 # add links to join the room 199 generateCustomLinks(fossilizedRoom, self._room) 202 fossilizedRoom['custom'] = generateCustomLinks(self._room) 203 200 204 # add link to retrieve logs 201 generateLogLink(fossilizedRoom, self._room, self._room.getConference() if len(self._room.getConferences()) is 1 else self._room.getConference().values()[0])205 fossilizedRoom['logs'] = generateLogLink(self._room, conference) 202 206 203 207 return fossilizedRoom … … 249 253 self._notify('editChatroom', {'oldTitle': oldRoom.getTitle(), 'newRoom':self._room}) 250 254 except ServiceError, e: 251 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Exception while editing: %s" %e)255 Logger.get('ext.im').error("Exception while editing: %s" %e) 252 256 raise ServiceError( message=_('Problem while accessing the database: %s' %e)) 253 257 except Exception, e: 254 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Weird exception while notifying observers: %s" %e)258 Logger.get('ext.im').error("Weird exception while notifying observers: %s" %e) 255 259 raise NoReportError( self.messages['editing'], explanation='roomExists') 256 260 … … 281 285 282 286 if modified: 283 Logger.get(' InstantMessaging (XMPP-Indico server)').info("The room %s has been modified by the user %s at %s hours" %(self._title, self._user.getName(), self._room.getModificationDate()))287 Logger.get('ext.im').info("The room %s has been modified by the user %s at %s hours" %(self._title, self._user.getName(), self._room.getModificationDate())) 284 288 285 289 ContextManager.get('mailHelper').sendMails() … … 307 311 self._notify('deleteChatroom', {'room': self._room}) 308 312 except ServiceError, e: 309 Logger.get(' InstantMessaging (XMPP-Indico server)').error(message=_('Problem deleting indexes in the database for chat room %s: %s' %(self._room.getTitle(), e)))313 Logger.get('ext.im').exception(_('Problem deleting indexes in the database for chat room %s' % self._room.getTitle())) 310 314 raise ServiceError( message=_('Problem deleting indexes in the database for chat room %s: %s' %(self._room.getTitle(), e))) 311 315 … … 320 324 req = urllib2.Request(url, None, {'Accept-Charset' : 'utf-8'}) 321 325 document = urllib2.urlopen(req) 322 Logger.get(' InstantMessaging (XMPP-Indico server)').info("The room %s has been deleted by the user %s at %s hours" %(self._title, self._user.getName(), nowutc()))326 Logger.get('ext.im').info("The room %s has been deleted by the user %s at %s hours" %(self._title, self._user.getName(), nowutc())) 323 327 324 328 ContextManager.get('mailHelper').sendMails() … … 388 392 room = DBHelpers.getChatroom(roomID) 389 393 except Exception, e: 390 Logger.get(' InstantMessaging (XMPP-Indico server)').warning("The user %s tried to re-use the chat room %s, but it was deleted before he clicked the Add button: %s" %(self._aw.getUser().getFullName(), roomID, e))394 Logger.get('ext.im').warning("The user %s tried to re-use the chat room %s, but it was deleted before he clicked the Add button: %s" %(self._aw.getUser().getFullName(), roomID, e)) 391 395 raise NoReportError(_('Some of the rooms were deleted from the other conference(s) they belonged to. Please refresh your browser')) 392 396 room.setConference(ConferenceHolder().getById(self._conference)) … … 394 398 fossilizedRoom = room.fossilizeMultiConference(ConferenceHolder().getById(self._conference)) 395 399 # add links to join the room 396 generateCustomLinks(fossilizedRoom,room)400 fossilizedRoom['custom'] = generateCustomLinks(room) 397 401 # add link to retrieve logs 398 generateLogLink(fossilizedRoom, room, room.getConference() if len(room.getConferences()) is 1 else room.getConference().values()[0])402 fossilizedRoom['logs'] = generateLogLink(room, room.getConferences().values()[0]) 399 403 rooms.append(fossilizedRoom) 400 404 except NoReportError, e: 401 Logger.get(' InstantMessaging (XMPP-Indico server)').error("Error adding chat rooms. User: %s. Chat room: %s. Traceback: %s" %(self._aw.getUser().getFullName(), roomID, e))405 Logger.get('ext.im').exception("Error adding chat rooms. User: %s. Chat room: %s" %(self._aw.getUser().getFullName(), roomID)) 402 406 raise ServiceError(message = _('There was an error trying to add the chat rooms. Please refresh your browser and try again')) 403 407 -
indico/MaKaC/plugins/InstantMessaging/XMPP/helpers.py
rb8c483 r010517 41 41 42 42 def generate(self): 43 44 43 link = re.sub('\[chatroom\]', self._chatroom.getTitle(), self._structure) 45 44 link = re.sub('\[host\]', self._chatroom.getHost(), link) … … 50 49 return link 51 50 52 def generateCustomLinks(var, chatroom): 51 52 def generateCustomLinks(chatroom): 53 53 linkList = PluginFieldsWrapper('InstantMessaging').getOption('customLinks') 54 # if some link type is specified 55 if linkList.__len__() > 0: 56 var['custom'] = [] 57 for link in linkList: 58 addLink(var['custom'], link['name'], GeneralLinkGenerator(chatroom, link['structure']).generate(), chatroom.getId()) 54 55 result = [] 56 for link in linkList: 57 result.append({'name': link['name'], 58 'link': GeneralLinkGenerator(chatroom, 59 link['structure']).generate() 60 }) 61 return result 59 62 60 63 61 def generateLogLink( var,chatroom, conf):64 def generateLogLink(chatroom, conf): 62 65 if XMPPLogsActivated(): 63 var['logs'] = UHConfModifChatSeeLogs.getURL(conf) 64 var['logs'].addParam('chatroom', chatroom.getId()) 65 var['logs'] = var['logs'].__str__() 66 url = UHConfModifChatSeeLogs.getURL(conf) 67 url.addParam('chatroom', chatroom.getId()) 68 return str(url) 69 else: 70 return None 66 71 67 72 -
indico/MaKaC/plugins/InstantMessaging/XMPP/options.py
rf7f228 r010517 71 71 </table>"}), 72 72 73 ("activateLogs", {"description": _("Make possible to see chat logs and attach them to the material \ 74 \ 75 REMEMBER, you will need to put in the Jappix dir the code.py file contained in the ext folder, inside the XMPP plugin."), 73 ("activateLogs", {"description": _("""Make possible to see chat logs and attach them to the material <div style="font-style: italic; margin-top:5px;">You will need to configure a web service in your XMPP server - see <a href="">here</a>.</div>"""), 76 74 "type": bool, 77 75 "defaultValue": False, -
indico/MaKaC/plugins/InstantMessaging/chatroom.py
rf7f228 r010517 40 40 self._owner = owner 41 41 self._creationDate = nowutc() 42 self._conference = PersistentMapping()43 self._conference [conference.getId()] = conference42 self._conferences = PersistentMapping() 43 self._conferences[conference.getId()] = conference 44 44 self._modificationDate = modificationDate 45 45 self._createdInLocalServer = createdInLocalServer … … 58 58 self._owner = values['user'] 59 59 #it has to be a dictionary with conferences, otherwise it'll make everything go wrong 60 self._conference [values['conference'].getId()] = values['conference']60 self._conferences[values['conference'].getId()] = values['conference'] 61 61 self._modificationDate = values['modificationDate'] 62 62 self._createdInLocalServer = values['createdInLocalServer'] … … 112 112 113 113 def setConference(self, conference): 114 if len(self._conference) is 0: 115 self._conference = PersistentMapping() 116 self._conference[conference.getId()] = conference 117 118 def getConference(self): 119 """ If there's only one conference in the dictionary it returns the conference itself, otherwise returns the dictionary""" 120 if len(self._conference) is 1: 121 return self._conference.values()[0] 122 elif len(self._conference) >1: 123 return self._conference 124 else: 125 raise ServiceError(message='No conferences found in the chat room %s'%self._name) 114 self._conferences[conference.getId()] = conference 126 115 127 116 def getConferences(self): 128 """ returns always the dictionary""" 129 return self._conference 117 return self._conferences 130 118 131 119 def getId(self): -
indico/MaKaC/plugins/InstantMessaging/indexes.py
rf7f228 r010517 44 44 if not self._root.has_key(self._index): 45 45 self._root[self._index] = self 46 self._ storingStructure= self._storingStructure()46 self._data = self._storingStructure() 47 47 self._indexToAccess = self._root[self._index] 48 self._ storingStructure= self._indexToAccess.get()48 self._data = self._indexToAccess.get() 49 49 50 50 def _indexCheckDelete(self, element): … … 57 57 def get(self): 58 58 #return self._indexToAccess 59 return self._ storingStructure59 return self._data 60 60 61 61 def index(self, element): … … 76 76 """ Index by conference. Using the conference id as the key, there will be a OOTreeSet inside with all the existing chat rooms for that conference""" 77 77 78 def __init__(self , conf):78 def __init__(self): 79 79 IMIndex.__init__(self, 'indexByConf') 80 self._conf = conf81 80 82 def index(self, element):81 def index(self, conf, element): 83 82 self._indexCheck() 84 83 85 84 # self.get is equivalent to root['indexByConf'] 86 if not self.get().has_key( self._conf):87 self.get()[ self._conf] = OOTreeSet()85 if not self.get().has_key(conf): 86 self.get()[conf] = OOTreeSet() 88 87 89 self.get()[ self._conf].insert(element)88 self.get()[conf].insert(element) 90 89 91 def unindex(self, element):92 self.get()[ self._conf].remove(element)90 def unindex(self, conf, element): 91 self.get()[conf].remove(element) 93 92 94 self._indexCheckDelete( self._conf)93 self._indexCheckDelete(conf) 95 94 96 95 … … 98 97 """ Index by user ID. We use a OOTreeSet to store the chat rooms""" 99 98 100 def __init__(self , id):99 def __init__(self): 101 100 IMIndex.__init__(self, 'indexByUser') 102 self._id = id103 101 104 def index(self, element):102 def index(self, userId, element): 105 103 self._indexCheck() 106 104 107 105 # self.get is equivalent to root['IndexByUser'] 108 if not self.get().has_key( self._id):109 self.get()[ self._id] = OOTreeSet()106 if not self.get().has_key(userId): 107 self.get()[userId] = OOTreeSet() 110 108 111 self.get()[ self._id].insert(element)109 self.get()[userId].insert(element) 112 110 113 def unindex(self, element):114 self.get()[ self._id].remove(element)111 def unindex(self, userId, element): 112 self.get()[userId].remove(element) 115 113 116 self._indexCheckDelete( self._id)114 self._indexCheckDelete(userId) 117 115 118 116 … … 120 118 """ Index by chat room name. We allow chat rooms to have the same name if they are in different servers. For each key we use a OOTreeSet to store them""" 121 119 122 def __init__(self , name):120 def __init__(self): 123 121 IMIndex.__init__(self, 'indexByCRName') 124 self._name = name125 122 126 123 def index(self, element): … … 146 143 self._indexCheckDelete(indexToRemove) 147 144 else: 148 self.get()[self._name].remove(element) 149 self._indexCheckDelete(self._name) 145 title = element.getTitle() 146 self.get()[title].remove(element) 147 self._indexCheckDelete(title) 150 148 151 149 … … 167 165 def unindex(self, element): 168 166 self.get().pop(element.getId()) 169 -
indico/MaKaC/plugins/InstantMessaging/pages.py
rb8c483 r010517 26 26 from MaKaC.common.fossilize import fossilize 27 27 from MaKaC.common.timezoneUtils import getAdjustedDate, nowutc, setAdjustedDate, DisplayTZ, minDatetime 28 from MaKaC.plugins import PluginsHolder 28 from MaKaC.plugins import PluginsHolder, InstantMessaging 29 29 from MaKaC.plugins.helpers import DBHelpers 30 30 from MaKaC.plugins.util import PluginFieldsWrapper … … 33 33 from MaKaC.plugins.InstantMessaging.XMPP.helpers import generateCustomLinks, generateLogLink, XMPPLogsActivated, DesktopLinkGenerator, WebLinkGenerator 34 34 from MaKaC.i18n import _ 35 import zope.interface 36 from indico.core.api import Component 37 from indico.core.api.conference import IEventDisplayContributor 38 35 39 36 40 class WPConfModifChat(WPConferenceModifBase): … … 50 54 def getJSFiles(self): 51 55 return WPConferenceModifBase.getJSFiles(self) + self._includeJSPackage('Plugins') 56 57 def getJSFiles(self): 58 return WPConferenceModifBase.getJSFiles(self) + \ 59 self._includeJSFile('InstantMessaging/js', 'InstantMessaging') 60 61 def getCSSFiles(self): 62 return WPConferenceModifBase.getCSSFiles(self) + \ 63 ['InstantMessaging/im.css'] 52 64 53 65 def _createTabCtrl(self): … … 70 82 if len(self._tabNames) > 0: 71 83 self._createTabCtrl() 72 wc = WConfModifChat(self._conf, self._activeTabName, self._tabNames, self._aw) 84 wc = WConfModifChat.forModule(InstantMessaging, self._conf, 85 self._activeTabName, self._tabNames, self._aw) 73 86 return wcomponents.WTabControl(self._tabCtrl, self._getAW()).getHTML(wc.getHTML({})) 74 87 else: … … 84 97 85 98 def _getBody(self, params): 86 wc = WConferenceInstantMessaging(self._conf, self._aw) 99 wc = WConferenceInstantMessaging.forModule(InstantMessaging, 100 self._conf, self._aw) 87 101 return wc.getHTML({}) 88 102 … … 91 105 self._sectionMenu.setCurrentItem(self._sectionMenu.getLinkByName("instantMessaging")) 92 106 107 108 class IMEventDisplayComponent(Component): 109 110 zope.interface.implements(IEventDisplayContributor) 111 112 # EventDisplayContributor 113 def injectCSSFiles(self, obj): 114 return ['InstantMessaging/im.css'] 93 115 94 116 … … 113 135 vars["Chatrooms"] = None 114 136 chatrooms = {} 115 vars['links']= {}137 links = {} 116 138 117 139 for cr in chatrooms: 118 vars['links'][cr.getId() ] = {} 119 generateCustomLinks(vars["links"][cr.getId()], cr) 120 generateLogLink(vars["links"][cr.getId()], cr, self._conf) 140 crinfo = links[cr.getId() ] = {} 141 crinfo['custom'] = generateCustomLinks(cr) 142 crinfo['logs'] = generateLogLink(cr, self._conf) 143 144 vars['links'] = links 121 145 122 146 vars['DefaultServer'] = PluginFieldsWrapper('InstantMessaging', 'XMPP').getOption('chatServerHost') … … 128 152 129 153 return vars 130 131 132 154 133 155 class WConferenceInstantMessaging(wcomponents.WTemplated): … … 150 172 for cr in vars["Chatrooms"]: 151 173 vars["Links"][cr.getId()] = {} 152 generateCustomLinks(vars["Links"][cr.getId()],cr)174 vars["Links"][cr.getId()]['custom'] = generateCustomLinks(cr) 153 175 154 176 return vars 155 -
indico/MaKaC/plugins/InstantMessaging/rh.py
rb8c483 r010517 26 26 from MaKaC.plugins.InstantMessaging.urlHandlers import UHConfModifChat, UHConfModifChatSeeLogs, UHConferenceInstantMessaging 27 27 from MaKaC.plugins.InstantMessaging.XMPP.helpers import LogLinkGenerator 28 from MaKaC.plugins import InstantMessaging 28 29 from MaKaC.webinterface.rh.conferenceDisplay import RHConferenceBaseDisplay 29 30 from MaKaC.webinterface.rh.conferenceModif import RHConferenceModifBase 30 31 from MaKaC.errors import MaKaCError 31 32 from MaKaC.i18n import _ 32 import urllib2 33 import urllib2, os 33 34 34 35 from indico.web.legacy import wrapUH 36 from indico.web.rh import RHHtdocs 37 38 class RHInstantMessagingHtdocs(RHHtdocs): 39 """ 40 Static file handler for InstantMessaging plugin 41 """ 42 43 _url = r"^/InstantMessaging/(?P<filepath>.*)$" 44 _local_path = os.path.join(InstantMessaging.__path__[0], 'htdocs') 45 35 46 36 47 class RHChatModifBase(RHConferenceModifBase): -
indico/MaKaC/plugins/InstantMessaging/tpls/ConferenceInstantMessaging.tpl
r2f5998 r010517 33 33 <td><div id='desc<%= cr.getId() %>'> <%= cr.getDescription()%></div></td> 34 34 35 <td> <%= _('Yes') if len(cr.getPassword()) > 0else _('No')%></td>35 <td> <%= _('Yes') if cr.getPassword() else _('No')%></td> 36 36 37 <% if cr.getShowPass() and len(cr.getPassword()) > 0:%>37 <% if cr.getShowPass() and cr.getPassword():%> 38 38 <td> <%= cr.getPassword()%> </td> 39 39 <% end %> 40 <% elif not cr.getShowPass() and len(cr.getPassword()) > 0:%>40 <% elif not cr.getShowPass() and cr.getPassword():%> 41 41 <td style="font-style:italic;"> <%= _('Not displayed')%> </td> 42 42 <% end %> … … 44 44 <td style="font-style:italic;"> - </td> 45 45 <% end %> 46 <% if PluginFieldsWrapper('InstantMessaging').getOption('customLinks').__len__() > 0: %>46 <% if len(PluginFieldsWrapper('InstantMessaging').getOption('customLinks')) > 0: %> 47 47 <td style="font-weight: bold;" nowrap><a id="joinLink<%= cr.getId() %>" name = "<%= cr.getId() %>" class="dropDownMenu highlight" href="#"><%= _("Join now!")%></a></td> 48 48 <% end %> -
indico/MaKaC/plugins/base.py
r6df324 r010517 103 103 #Register it. We take the list of the interfaces implemented by the component 104 104 implementedInterfaces = list(zope.interface.implementedBy(component)) 105 105 106 for interface in implementedInterfaces: 106 107 … … 139 140 try: 140 141 results.append(f(obj, *params)) 141 except NoReportError, e:142 raise NoReportError(str(e))143 142 except Exception, e: 144 143 Logger.get('PluginNotifier').exception("Exception while calling subscriber %s" % str(subscriber.__class__)) -
indico/MaKaC/plugins/helpers.py
rb8c483 r010517 50 50 def getChatroomList(cls, conf): 51 51 conf = str(conf.getId()) 52 index = IndexByConf( conf).get()52 index = IndexByConf().get() 53 53 54 54 if not index.has_key(conf): … … 68 68 """ Will return the chat rooms created by the requested user """ 69 69 userID = str(user['id']) 70 index = IndexByUser( userID).get()70 index = IndexByUser().get() 71 71 72 72 if not index.has_key(userID): -
indico/MaKaC/webinterface/pages/base.py
r216b1e r010517 25 25 from MaKaC.i18n import _ 26 26 27 class WPBase: 27 from MaKaC.plugins.base import OldObservable 28 29 30 class WPBase(OldObservable): 28 31 """ 29 32 """ -
indico/MaKaC/webinterface/pages/conferences.py
r216b1e r010517 69 69 from MaKaC.fossils.conference import IConferenceEventInfoFossil 70 70 from MaKaC.common.Conversion import Conversion 71 from MaKaC.common.logger import Logger 71 72 from MaKaC.plugins.base import OldObservable 72 from MaKaC.common.logger import Logger73 74 73 from indico.modules import ModuleHolder 75 74 … … 120 119 return urlHandlers.UHSignOut.getURL(str(urlHandlers.UHConferenceDisplay.getURL(self._conf))) 121 120 122 class WPConferenceDisplayBase( WPConferenceBase ):121 class WPConferenceDisplayBase( WPConferenceBase, OldObservable ): 123 122 124 123 def getJSFiles(self): … … 126 125 self._includeJSPackage('MaterialEditor') 127 126 128 class WPConferenceDefaultDisplayBase( WPConferenceBase, OldObservable ): 127 def getCSSFiles(self): 128 # flatten returned list 129 130 return WPConferenceBase.getCSSFiles(self) + \ 131 sum(self._notify('injectCSSFiles'), []) 132 133 class WPConferenceDefaultDisplayBase( WPConferenceBase): 129 134 navigationEntry = None 130 135 … … 919 924 self._webcastadd = True 920 925 926 def getCSSFiles(self): 927 # flatten returned list 928 929 return WPConferenceBase.getCSSFiles(self) + \ 930 sum(self._notify('injectCSSFiles'), []) 921 931 922 932 def getJSFiles(self): -
indico/MaKaC/webinterface/wcomponents.py
r6df324 r010517 81 81 82 82 @classmethod 83 def forModule(cls, module ):84 tplobj = cls( )83 def forModule(cls, module, *args): 84 tplobj = cls(*args) 85 85 # HACK :/ 86 86 tplobj._dir = os.path.join(module.__path__[0], 'tpls') -
indico/core/api/conference.py
rdb8136 r010517 19 19 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 20 20 21 from indico.core.api import I Listener, IContributor21 from indico.core.api import IContributor 22 22 23 23 … … 89 89 pass 90 90 91 92 class IEventDisplayContributor(IContributor): 93 94 """ 95 Aggregates extension points that relate to event display pages 96 """ 97 98 def injectCSSFiles(self, obj): 99 """ 100 Observers should contribute with CSS files they wish to add to the 101 <head></head> block 102 """ -
indico/ext/livesync/chrome.py
r756437 r010517 169 169 170 170 171 NUM_CELLS = 10172 173 174 171 class WPluginAgentStatus(WTemplated): 172 173 NUM_CELLS = 10 175 174 176 175 def _tsToDate(self, ts): … … 207 206 showTS = ts == first or ts in agentMap 208 207 209 if showTS or extra < 10:208 if showTS or extra < self.NUM_CELLS: 210 209 if breakContinuity: 211 210 queue.append(('break', numBreakTS, sumElems, [])) -
indico/htdocs/css/Default.css
r2f5998 r010517 4189 4189 } 4190 4190 4191 /* CHAT */4192 4193 td.chatTitleCell {4194 color: #523D04;4195 /*text-align: center;*/4196 padding-bottom: 3px;4197 }4198 4199 td.chatCell {4200 padding: 0px;4201 padding-right: 30px;4202 padding-top: 10px;4203 padding-bottom: 5px;4204 /*text-align: center;*/4205 white-space: nowrap;4206 }4207 4208 td.chatCellNarrow {4209 padding: 0px;4210 padding-right: 30px;4211 padding-top: 10px;4212 padding-bottom: 5px;4213 width: 0px;4214 white-space: nowrap;4215 }4216 4217 td.titleChat {4218 padding-top: 5px;4219 font-size: 13px;4220 font-family: Verdana, Arial;4221 color: #523D04;4222 }4223 4224 .chatInfoCell {4225 padding: 0px;4226 padding-top: 15px;4227 padding-left: 20px;4228 padding-bottom: 5px;4229 padding-right: 15px;4230 background-color: #FEFEFE;4231 -moz-box-shadow: 2px 2px 2px #444444;4232 -moz-border-radius-bottomleft:10px;4233 -moz-border-radius-bottomright:10px;4234 -moz-border-radius-topleft:10px;4235 -moz-border-radius-topright:10px;4236 }4237 4238 div.chatListDiv {4239 margin-bottom: 10px;4240 height:200px;4241 width: 300px;4242 border: 1px solid #CCCCCC;4243 overflow: auto;4244 margin-top: 10px;4245 }4246 4247 ul.chatList {4248 border: none;4249 display: block;4250 list-style-type: none;4251 padding-left: 0px;4252 margin: 0;4253 4254 }4255 4256 ul.chatList li {4257 cursor: pointer;4258 padding: 5px;4259 border-bottom: 1px solid #DDDDDD;4260 }4261 4262 ul.chatList li.selected {4263 background-color: #CDEB8B;4264 }4265 4266 div.chatTable {4267 color: #523D04;4268 -moz-box-shadow: 4px 4px 4px #444444;4269 -moz-border-radius-bottomleft:10px;4270 -moz-border-radius-bottomright:10px;4271 -moz-border-radius-topleft:10px;4272 -moz-border-radius-topright:10px;4273 }4274 4275 div.chatAdvancedTabTitle {4276 font-size:13px;4277 background:none repeat scroll 0 0 white;4278 position:absolute;4279 padding-right:5px;4280 }4281 4282 div.chatAdvancedTabTitleLine {4283 height: 9px;4284 border-bottom: 1px dotted #777;4285 position: relative;4286 min-width: 200px;4287 }4288 4289 div.chatAdvancedTabCheckboxDiv {4290 margin-left:50px;4291 padding-top:5px;4292 }4293 4294 td.chatInfoLeftCol {4295 vertical-align: top;4296 text-align: left;4297 padding-right: 5px;4298 white-space: nowrap;4299 color: #523D04;4300 }4301 4302 4303 4191 /* COLLABORATION */ 4304 4192 … … 4782 4670 } 4783 4671 4784 /* Instant Messaging display pages */4785 4786 .CRDisplayMoreInfo {4787 color: #0B63A5;4788 text-decoration: none;4789 cursor: pointer;4790 }4791 4792 .CRDisplayHideInfo {4793 color: #B38B1F;4794 text-decoration: none;4795 cursor: pointer;4796 }4797 4798 div.CRDisplayInfoLine {4799 padding-bottom: 8px;4800 }4801 4802 4803 4672 /* Collaboration display pages */ 4804 4673
Note: See TracChangeset
for help on using the changeset viewer.
