Trees | Indices | Help |
|
---|
|
1 ############################################################################## 2 # 3 # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 4 # 5 # This content is made available according to terms specified in 6 # License.zenoss under the directory where your Zenoss product is installed. 7 # 8 ############################################################################## 9 10 11 from Products.Five.browser import BrowserView 12 13 from Products.ZenUtils.jsonutils import json 14 from Products.ZenModel.ZenossSecurity import * 15 from Products.ZenWidgets.interfaces import IUserMessages, IBrowserMessages 16 from Products.ZenWidgets import messaging19 """ 20 Delivers up user messages for the current user to the client-side 21 YAHOO.zenoss.Messenger. 22 """ 23 @json41 4625 messages = IUserMessages(self.context).get_unread() 26 messages.extend(IBrowserMessages(self.context).get_unread()) 27 messages.sort(key=lambda x:x.timestamp) 28 result = [] 29 for message in messages: 30 result.append(dict( 31 sticky=message.priority>=messaging.CRITICAL and True or False, 32 image=message.image, 33 title=message.title, 34 body=message.body, 35 priority=message.priority 36 )) 37 message.mark_as_read() 38 result = {'totalRecords':len(result), 39 'messages':result} 40 return result
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1.1812 on Mon Jul 30 17:11:30 2012 | http://epydoc.sourceforge.net |