Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Plugins.Application.Mediators.AContentMediator Class Reference
+ Inheritance diagram for Plugins.Application.Mediators.AContentMediator:

Public Member Functions

def __init__
 Constructor.
 
def init
 Initializer.
 
def __del__
 Destructor.
 
def openLog
 Construct or open a log file suitable for error and debugging output. More...
 
def generate
 Generate the named event.
 
def error
 Generate an error event. More...
 
def log
 Log the specified item. More...
 
def displayError
 Display an error that may occur while running the mediator.
 
def loadPlugin
 Load the specified plugin. More...
 
def fetchContent
 Fetch content from the content provider. More...
 
def renderView
 Render content using the view provider. More...
 
def on
 Set the handler for the specified event. More...
 
def onMultiple
 Set handlers for multiple events. More...
 
def handlerFor
 Retrieve the handler for the specified event. More...
 
def generates
 Determine whether or not the object generates the named event. More...
 
def ContentProvider
 Set or retrieve the content provider for the class. More...
 
def ViewProvider
 Set or retrieve the view provider for the class. More...
 

Member Function Documentation

def Plugins.Application.Mediators.AContentMediator.ContentProvider (   Self,
  params,
  keywordParams 
)

Set or retrieve the content provider for the class.

If params is empty, this method simply returns the current content provider. Alternatively, params may contain one of the following:

  • A single class instance, which should either be a reference to an instance of AContentProvider (or its descendants);
  • A single Python callable object that will return an iterable object when it is called.
  • Two strings: the first should be the name of a plugin to load, and the second should indicate the name of the class or function within that plugin to use as the content provider. If a class name is specified, the class will be instantiated and passed any keyword parameters specified by keywordParams. If a function is specified, it is expected to return an iterable object when called.
def Plugins.Application.Mediators.AContentMediator.error (   Self,
  Error 
)

Generate an error event.

If an event handler is specified for this event, it will receive an instance of AnEvent with a parameter named Error that refers to the exception that was raised because of the error. The handler should set Event.handled() to True in order to prevent the exception from being raised; otherwise, if the event is not handled, it will be logged to the log associated with the class, and then an exception will be raised.

This routine generates the error event.

def Plugins.Application.Mediators.AContentMediator.fetchContent (   Self)

Fetch content from the content provider.

This routine will attempt to call the class or function provided to the content mediator and will return the results of that call.

This routine generates the fetchContent event.

def Plugins.Application.Mediators.AContentMediator.generates (   Self,
  eventName 
)

Determine whether or not the object generates the named event.

def Plugins.Application.Mediators.AContentMediator.handlerFor (   Self,
  eventName 
)

Retrieve the handler for the specified event.

If eventName refers to an event that is not generated by the class, this routine returns None.

def Plugins.Application.Mediators.AContentMediator.loadPlugin (   Self,
  pluginName,
  identifier = None 
)

Load the specified plugin.

This method generates the loadPlugin event.

If identifier specifies the name of an identifier defined in the plugin (a class, function, variable, etc.), then this method will return a reference to that item; otherwise, it returns a reference to the module itself.

def Plugins.Application.Mediators.AContentMediator.log (   Self,
  Item,
  freeItem = True 
)

Log the specified item.

This routine generates the log event.

def Plugins.Application.Mediators.AContentMediator.on (   Self,
  eventName,
  newHandler 
)

Set the handler for the specified event.

The newHandler parameter should refer to a callable object that can receive the event object.

This routine returns the previous handler for the specified event.

def Plugins.Application.Mediators.AContentMediator.onMultiple (   Self,
  events 
)

Set handlers for multiple events.

The parameters passed in events should follow the same format as those passed to the constructor for AnEventfulObject: the event to handle should be specified by prefixing the event name with "on".

This method returns a dictionary object that contains the previous handler for each event. Only those events in \ p events which are actually generated by the class will be registered; all other event names are discarded.

def Plugins.Application.Mediators.AContentMediator.openLog (   Self,
  logFileName = None 
)

Construct or open a log file suitable for error and debugging output.

This method generates the openLog event.

def Plugins.Application.Mediators.AContentMediator.renderView (   Self,
  content 
)

Render content using the view provider.

This routine will attempt to call the class or function provided to the content mediator and will return the results of that call.

This routine generates the renderView event.

def Plugins.Application.Mediators.AContentMediator.ViewProvider (   Self,
  params,
  keywordParams 
)

Set or retrieve the view provider for the class.

If params is empty, this method simply returns the current view provider. Alternatively, params may contain one of the following:

  • A single class instance, which should either be a reference to an instance of AView (or its descendants);
  • A single Python callable object that accepts an iterable object, and that will return a string when it is called.
  • Two strings: the first should be the name of a plugin to load, and the second should indicate the name of the class or function within that plugin to use as the view provider. If a class name is specified, the class will be instantiated and passed any keyword parameters specified by keywordParams. If a function is specified, it is expected to return a string when called.

The documentation for this class was generated from the following file: