Source code for pyams_notify.interfaces

#
# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#

__docformat__ = 'restructuredtext'


# import standard library

# import interfaces
from zope.interface import Interface

# import packages
from zope.schema import TextLine, Text, Dict, Datetime

from pyams_notify import _


CACHE_CONFIGURATION_KEY = 'pyams_notify_ws.cache_server'

CACHE_QUEUE_KEY = b'PyAMS:notify:messages_queue'


[docs]class INotification(Interface): """Notification interface""" action = TextLine(title=_("Notification action")) category = TextLine(title=_("Notification category")) title = TextLine(title=_("Notification title")) message = Text(title=_("Notification message")) source = Dict(title=_("Notification source"), description=_("Attributes of the principal which emitted the notification"), key_type=TextLine(), value_type=TextLine()) target = Dict(title=_("Notification target"), description=_("Notification targets (principals, roles...)"), key_type=TextLine()) url = TextLine(title=_("Notification URL"), description=_("URL targetted by this notification"), required=False) timestamp = TextLine(title=_("Notification timestamp")) user_data = Dict(title=_("User data")) def send(self): """Send notification to recipients"""
[docs]class INotificationHandler(Interface): """Notification handler interface""" def get_target(self): """Get notification target"""
[docs]class IUserProfileAnnotations(Interface): """User profile annotations subscriptions"""