Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 14 from Products.Five.browser import BrowserView 15 16 from Products.ZenUtils.json import json 17 from Products.ZenModel.ZenossSecurity import * 18 from Products.ZenWidgets.interfaces import IUserMessages, IBrowserMessages 19 from Products.ZenWidgets import messaging 2022 """ 23 Delivers up user messages for the current user to the client-side 24 YAHOO.zenoss.Messenger. 25 """ 26 @json44 45 4928 messages = IUserMessages(self.context).get_unread() 29 messages.extend(IBrowserMessages(self.context).get_unread()) 30 messages.sort(key=lambda x:x.timestamp) 31 result = [] 32 for message in messages: 33 result.append(dict( 34 sticky=message.priority>=messaging.CRITICAL and True or False, 35 image=message.image, 36 title=message.title, 37 body=message.body, 38 priority=message.priority 39 )) 40 message.mark_as_read() 41 result = {'totalRecords':len(result), 42 'messages':result} 43 return result
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu May 7 11:46:37 2009 | http://epydoc.sourceforge.net |