org.davesag.generica.controller
Interface Presenter

All Superinterfaces:
ActionController, Controller
All Known Implementing Classes:
AbstractUserProfileController, GenericContentSelector

public interface Presenter
extends ActionController

An implementation of the Presenter interface must be able to load up the request with information useful for the GUI to present to the user. It functions as an assistant to the GUI but often contains business logic specific information.

An example may be a Controller that works out which navigation buttons to show on a page. It is quite reasonable for one Presenter to in turn load others and multiple Presenters may be specified in the Action configuration.
Although it is possible, a Presenter should avoid populating the active Pipe or Session, and must avoid writing data back to the persistent store. You can pass a Map of named parameters to the Presenter's prepare method which are extrcted from the Action's config in struts-config.cml as follows:

          presentation-param = someparam;
 
in which case it will be held in a Map under the key "param" or
          presentation-param0 = data:somedata;
          presentation-param1 = fish:somefish;
          ...
          presentation-paramn = whatever:somewhatever;
 

White space is ignored and the params do not need to be sequential.

Since:
Generica 1.0
Version:
CVS Revision $Id: Presenter.java,v 1.3 2004/03/30 13:00:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Method Summary
 void prepare(Map params)
          Prep the request with any presentation data needed for the coming page.
 
Methods inherited from interface org.davesag.generica.controller.ActionController
setAction
 
Methods inherited from interface org.davesag.generica.controller.Controller
setForm, setRequest, setResponse
 

Method Detail

prepare

public void prepare(Map params)
             throws Exception
Prep the request with any presentation data needed for the coming page.

Parameters:
params - presentation params.
Throws:
Exception - if something went wrong.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.