org.abstracthorizon.danube.beanconsole
Class DisplayController

java.lang.Object
  extended by org.abstracthorizon.danube.beanconsole.DisplayController
All Implemented Interfaces:
Controller, ApplicationContextAware

public class DisplayController
extends Object
implements Controller, ApplicationContextAware

Controller that processes request, select the object and prepares data for the view

Author:
Daniel Sendula

Field Summary
protected  String componentPath
          Component path this controller is to be working from
protected  String pageName
          If path defined as a pattern to a specific page (index.html for instance) then it needs to be stripped of component resource path before it is used
protected  Object root
          Root object
protected  ApplicationContext rootContext
          Application context this controller is running under
 
Constructor Summary
DisplayController()
           
 
Method Summary
 String getComponentPath()
          Returns component path
 String getPageName()
          Returns page name
 Object getRootObject()
          Returns root object.
 ModelAndView handleRequest(Connection connection)
          Method that handles a request.
 void setApplicationContext(ApplicationContext context)
          Sets root application context in case root is not set.
 void setComponentPath(String componentPath)
          Sets component path
 void setPageName(String pageName)
          Sets page name
 void setRootObject(Object root)
          Sets root object.
protected  void updateProperties(Object current, HTTPConnection httpConnection, Map<String,Object> model)
          Sets properties of the selected bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected Object root
Root object


rootContext

protected ApplicationContext rootContext
Application context this controller is running under


componentPath

protected String componentPath
Component path this controller is to be working from


pageName

protected String pageName
If path defined as a pattern to a specific page (index.html for instance) then it needs to be stripped of component resource path before it is used

Constructor Detail

DisplayController

public DisplayController()
Method Detail

handleRequest

public ModelAndView handleRequest(Connection connection)
Method that handles a request. It returns following entries in model's map:

For the way navigation is done check BeanHelper.navigate(Object, String) method documentation.

Specified by:
handleRequest in interface Controller
Parameters:
connection - connection action was invoked over
Returns:
model and view response

updateProperties

protected void updateProperties(Object current,
                                HTTPConnection httpConnection,
                                Map<String,Object> model)
Sets properties of the selected bean.

Parameters:
current - selected bean
httpConnection - http connection
model - model

setApplicationContext

public void setApplicationContext(ApplicationContext context)
Sets root application context in case root is not set.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
context - application context

getRootObject

public Object getRootObject()
Returns root object. If not set then rootContext is used instead.

Returns:
root object

setRootObject

public void setRootObject(Object root)
Sets root object.

Parameters:
root - root object.

getComponentPath

public String getComponentPath()
Returns component path

Returns:
component path

setComponentPath

public void setComponentPath(String componentPath)
Sets component path

Parameters:
componentPath - component path

getPageName

public String getPageName()
Returns page name

Returns:
page name

setPageName

public void setPageName(String pageName)
Sets page name

Parameters:
pageName - page name


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.