org.enhydra.barracuda.contrib.sam.xmlform
Class ModifyDomViewHandler

java.lang.Object
  extended byorg.enhydra.barracuda.core.event.DefaultBaseEventListener
      extended byorg.enhydra.barracuda.core.event.helper.DefaultViewHandler
          extended byorg.enhydra.barracuda.contrib.sam.xmlform.ModifyDomViewHandler
All Implemented Interfaces:
BaseEventListener, EventListener
Direct Known Subclasses:
XmlFormViewHandler

public abstract class ModifyDomViewHandler
extends DefaultViewHandler

Pretty similar class to BTemplateViewHandler. The main differences are

Version:
$Id: ModifyDomViewHandler.java,v 1.4 2004/02/01 05:16:27 christianc Exp $
Author:
Stefan Armbruster

Field Summary
protected static org.apache.log4j.Logger logger
           
protected  BTemplate templateComp
           
 
Fields inherited from class org.enhydra.barracuda.core.event.helper.DefaultViewHandler
localLogger, recycleChildren, vc
 
Fields inherited from class org.enhydra.barracuda.core.event.DefaultBaseEventListener
idStr
 
Constructor Summary
ModifyDomViewHandler()
           
 
Method Summary
 BTemplate getBTemplate()
          Provide a handle to the underlying BTemplate component
abstract  Class getTemplateClass(ViewContext vc)
          Return an instance of the template class (must implement Document)
abstract  Object getTemplateModels(ViewContext vc)
          abstract method for getting als required models
 Document handleViewEvent(BComponent root)
          Generate the view
protected  void modifyDOM(Document page, ViewContext vc)
          Placeholder for DOM-modifications prior to directive mappings.
 
Methods inherited from class org.enhydra.barracuda.core.event.helper.DefaultViewHandler
getDOMWriter, getViewContext, handleViewEvent, postCompRender, preCompRender, setViewContext
 
Methods inherited from class org.enhydra.barracuda.core.event.DefaultBaseEventListener
getListenerID, handleControlEvent, handleEvent, handleOtherEvent, isHandled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

templateComp

protected BTemplate templateComp
Constructor Detail

ModifyDomViewHandler

public ModifyDomViewHandler()
Method Detail

getTemplateModels

public abstract Object getTemplateModels(ViewContext vc)
                                  throws EventException,
                                         javax.servlet.ServletException,
                                         IOException
abstract method for getting als required models

Parameters:
vc - the ViewContext of the current RenderEvent
Returns:
either a single model or a List of models
Throws:
EventException
javax.servlet.ServletException
IOException

getTemplateClass

public abstract Class getTemplateClass(ViewContext vc)
                                throws EventException,
                                       javax.servlet.ServletException,
                                       IOException
Return an instance of the template class (must implement Document)

Throws:
EventException
javax.servlet.ServletException
IOException

getBTemplate

public BTemplate getBTemplate()
Provide a handle to the underlying BTemplate component


modifyDOM

protected void modifyDOM(Document page,
                         ViewContext vc)
                  throws EventException,
                         javax.servlet.ServletException,
                         IOException
Placeholder for DOM-modifications prior to directive mappings. The default implementation is empty.

Parameters:
page - a instance of the class returned by getTemplateClass(org.enhydra.barracuda.core.comp.ViewContext)
vc - the context of the current event
Throws:
EventException
javax.servlet.ServletException
IOException

handleViewEvent

public Document handleViewEvent(BComponent root)
                         throws EventException,
                                javax.servlet.ServletException,
                                IOException
Generate the view

Specified by:
handleViewEvent in class DefaultViewHandler
Parameters:
root - the root component which will get rendered as a result of this request
Returns:
the Document to be rendered
Throws:
IOException
javax.servlet.ServletException
EventException


Copyright © 2003 BarracudaMVC.org All Rights Reserved.