ploneintranet.messaging package

Submodules

ploneintranet.messaging.events module

class ploneintranet.messaging.events.MessageSendEvent(message)

Bases: object

ploneintranet.messaging.interfaces module

interface ploneintranet.messaging.interfaces.IConversation

Bases: zope.interface.Interface

A conversation between the inbox user and another user. It contains the actual messages.

username = <zope.schema._bootstrapfields.Text object>

The username of the other user (not the inbox user)

new_messages_count = <zope.schema._bootstrapfields.Int object>

Number of unread messages in the conversation

add_message(message)

Add a message that provides IMessage.

get_messages()

Return all messages.

mark_read()

Mark the conversation and all contained messages as read.

interface ploneintranet.messaging.interfaces.IInbox

Bases: zope.interface.Interface

An inbox for an user and the container for conversations.

get_conversations()

Return all conversations stored in the inbox.

new_messages_count = <zope.schema._bootstrapfields.Int object>

Number of unread messages in the inbox

add_conversation(conversation)

Add the conversation conversation to the inbox.

interface ploneintranet.messaging.interfaces.IInboxes

Bases: zope.interface.Interface

Container holding inboxes.

send_message(sender, recipient, text, created=None)

Send a message. This will create Inboxes, Conversations and Messages as needed.

sender (unicode)
The sender’s username.
recipient (unicode)
The recipient’s username.
text (unicode)
The Text of the message.
created (datetime.datetime, optional)
The creation date. If none is given, the current time will be used.
Raises:
ValueError
If the user is blocked, sender and recipient are identical or the message has no text.

Returns: None

add_inbox(username)

Add an inbox for the user username. Returns the inbox.

interface ploneintranet.messaging.interfaces.IMessage

Bases: zope.interface.Interface

A message.

sender = <zope.schema._bootstrapfields.TextLine object>

Username of the sender

created = <zope.schema._field.Datetime object>

Time the Message was created

text = <zope.schema._bootstrapfields.Text object>

Text of the message

recipient = <zope.schema._bootstrapfields.TextLine object>

Username of the recipient

new = <zope.schema._bootstrapfields.Bool object>

Is the message read

uid = <zope.schema._bootstrapfields.Text object>

UUID unique within a conversation

interface ploneintranet.messaging.interfaces.IMessageSendEvent

Bases: zope.interface.Interface

message = <zope.interface.interface.Attribute object>

The message Object

interface ploneintranet.messaging.interfaces.IMessagingLocator

Bases: zope.interface.Interface

A utility used to locate conversations and messages.

get_inboxes()

Return an object providing IInboxes.

interface ploneintranet.messaging.interfaces.IMessagingTool

Bases: zope.interface.Interface

Tool to store messages in the ZODB.

ploneintranet.messaging.messaging module

class ploneintranet.messaging.messaging.BTreeDictBase

Bases: Persistence.Persistent

Pass through the dict api to a BTree saved in self.data This is required cause attributes on **BTree subclasses seem to not be persistent. It also takes care to set a __parent__ pointer

keys()
class ploneintranet.messaging.messaging.Conversation(username, created=None)

Bases: ploneintranet.messaging.messaging.BTreeDictBase

Pass through the dict api to a BTree saved in self.data This is required cause attributes on **BTree subclasses seem to not be persistent. It also takes care to set a __parent__ pointer

add_message(message)
created = None
generate_key(message)

Generate a long int key for a message.

get_messages()
last = None
mark_read(message=None)
new_messages_count = 0
to_dict()
to_long(dt)

Turns a datetime object into a long.

Since this is used as BTree key it must be sequential, hence we force UTC.

update_new_messages_count(difference)
username = None
class ploneintranet.messaging.messaging.Inbox(username)

Bases: ploneintranet.messaging.messaging.BTreeDictBase

Pass through the dict api to a BTree saved in self.data This is required cause attributes on **BTree subclasses seem to not be persistent. It also takes care to set a __parent__ pointer

add_conversation(conversation)
get_conversations()
is_blocked(username)
new_messages_count = 0
update_new_messages_count(difference)
username = None
class ploneintranet.messaging.messaging.Inboxes

Bases: ploneintranet.messaging.messaging.BTreeDictBase

Pass through the dict api to a BTree saved in self.data This is required cause attributes on **BTree subclasses seem to not be persistent. It also takes care to set a __parent__ pointer

add_inbox(username)
send_message(sender, recipient, text, created=None)
class ploneintranet.messaging.messaging.Message(sender, recipient, text, created)

Bases: Persistence.Persistent

Persistent ExtensionClass

created = None
new = True
recipient = None
sender = None
text = None
to_dict()
uid = None
class ploneintranet.messaging.messaging.MessagingLocator

Bases: object

A utility used to locate conversations and messages.

get_inboxes()

ploneintranet.messaging.testing module

ploneintranet.messaging.tool module

class ploneintranet.messaging.tool.MessagingTool

Bases: Products.CMFCore.utils.UniqueObject, OFS.SimpleItem.SimpleItem, ploneintranet.messaging.messaging.Inboxes

Provide IInboxes as a tool.

id = 'ploneintranet_messaging'
meta_type = 'ploneintranet.messaging tool'

Module contents