org.davesag.generica.controller
Class GenericContentSelector

java.lang.Object
  extended byorg.davesag.generica.controller.AbstractController
      extended byorg.davesag.generica.controller.AbstractActionController
          extended byorg.davesag.generica.controller.AbstractHibernateController
              extended byorg.davesag.generica.controller.GenericContentSelector
All Implemented Interfaces:
ActionController, Controller, Presenter

public class GenericContentSelector
extends AbstractHibernateController
implements Presenter

This controller manages presentation of SiteCopy for your application. You must provide the appropriate section name as a presentation-param in the action definition's parameter in struts-config.xml file.

eg:

   <action
                path="/out/about"
                type="org.davesag.generica.servlet.action.ForwardAction"
                parameter="presentation-controller=com.myapp.controller.GenericContentSelector;
                                        presentation-param=section:about">
                <forward name="page" path="about.page"/>
        </action>
 

Since:
Generica 1.0
Version:
CVS Revision $Id: GenericContentSelector.java,v 1.7 2004/04/06 15:40:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
SiteCopyPeer.loadLatest(net.sf.hibernate.Session, java.lang.String, java.util.Locale)

Field Summary
 
Fields inherited from class org.davesag.generica.controller.AbstractActionController
theAction
 
Fields inherited from class org.davesag.generica.controller.AbstractController
theForm, theRequest, theResponse, theSession
 
Constructor Summary
GenericContentSelector()
           
 
Method Summary
 void prepare(Map params)
          Loads the appropriate piece of SiteCopy into the request based on the current Locale and the last modified date of the copy.
 
Methods inherited from class org.davesag.generica.controller.AbstractHibernateController
getHibernateSession
 
Methods inherited from class org.davesag.generica.controller.AbstractActionController
getAction, getMessages, setAction
 
Methods inherited from class org.davesag.generica.controller.AbstractController
getApplication, getForm, getLocale, getRequest, getResponse, getSession, setForm, setRequest, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.controller.ActionController
setAction
 
Methods inherited from interface org.davesag.generica.controller.Controller
setForm, setRequest, setResponse
 

Constructor Detail

GenericContentSelector

public GenericContentSelector()
Method Detail

prepare

public void prepare(Map params)
             throws Exception
Loads the appropriate piece of SiteCopy into the request based on the current Locale and the last modified date of the copy. If there is no matching SiteCopy then loads null

Specified by:
prepare in interface Presenter
Parameters:
params - expecting param called 'section' with some valid value.
Throws:
Exception - if anything goes wrong.
See Also:
SiteCopyPeer


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