You are not logged in Log in Join
You are here: Home » Members » k_vertigo » deadly » BboardInterfaces.py » View File

Log in
Name

Password

 

BboardInterfaces.py

File details
Size
3 K
File type
text/plain

File contents

"""
  Author: Kapil <[email protected]>
  
  Purpose: Interface Definition For Bboard
  
  Date: 6/1/2002
  
  CVS: $Id: $
  
  Todo: generic schema system
  
  License: GPL <www.fsf.org>

"""

from Namespace import Base

class IBBoardMetaData(Base):
    
    def author():
        """
        return the name of the author
        """
    def modification_time():
        """
        return the last modified time,
        this is application not zodb mod time
        """
    def title():
        """
        return the title of the content
        """
        
class IBBoardPolicy(Base):
    """
    """


class IBBoardPolicyManaged(Base):
        
    def set_policy_options(self, **kw):
        """
        sets policy options
        """

    def get_policy():
        """
        gets the policy for this object
        """

class IBBoardMutableProperties(Base):
    
    def set_properties(**kw):
        """
        set basic properties
        """
        
        
class IBBoard(IBBoardPolicyManaged): 

    def add_forum(forum_id):
        """
        adds a new forum to the bboard
        """

    def remove_forum(forum_id):
        """
        remove a forum based on id
        """
        
    def search_messages(self, query):
        """
        search through messages, threads, forums
        """
        
    def get_bboard_catalog(self):
        """
        returns the catalog used for this bboard
        """
    
class IForum(Base):
    
    def get_bboard():
        """
        get the containing bboard
        """
        
    def add_thread(**kw):
        """
        adds a new thread to the forum, returns
        the thread id.
        """
        
    def get_thread(thread_id):
        """
        retrieves a thread given a thread id
        """
    
    def remove_thread(thread_id):
        """
        removes a thread from the forum
        """
    
    def get_latest_posts(limit=10):
        """
        retrieves up to limit of the latest
        messages in the forum
        """
        
class IThread(Base):
    
    def get_forum():
        """
        get the containing forum
        """
        
    def add_message(message_subject, 
                    message_body.
                    ):
        """
        adds a new message return the message id
        """
    
    def get_message(message_id):
        """
        retrieves the message
        """
    
    def get_messages(**kw):
        """
        retrieves all messages, kw args for sorting
        and retrieval options
        """

class IBBoardMessage(Base):

    def get_thread():
        """
        get the containing thread
        """
    
    def add_response(message_subject,
                     message_body):
        """
        add a response return message id
        """
        
    def add_attachment(file):
        """
        add a file attachment
        """
        
    def has_attachment():
        """
        return 0 or 1 if has attachment
        """

    def get_responses():
        """
        return messages that were in response to this one.
        """