org.infoglue.deliver.invokers
Class PageInvoker

java.lang.Object
  extended by org.infoglue.deliver.invokers.PageInvoker
Direct Known Subclasses:
ComponentBasedHTMLPageInvoker, HTMLPageInvoker

public abstract class PageInvoker
extends java.lang.Object

Author:
Mattias Bogeblad This interface defines what a Invoker of a page have to be able to do. The invokers are used to deliver a page to the user in a certain fashion.

Constructor Summary
PageInvoker()
           
 
Method Summary
 void cachePage()
          This method is used to allow pagecaching on a general level.
 void deliverPage()
          This method is used to send the page out to the browser or other device.
 org.exolab.castor.jdo.Database getDatabase()
           
abstract  PageInvoker getDecoratedPageInvoker()
          This method should return an instance of the class that should be used for page editing inside the tools or in working.
 java.util.Map getDefaultContext()
          Creates and returns a defaultContext, currently with the templateLogic and if the portal support is enabled the portalLogic object.
 DeliveryContext getDeliveryContext()
           
 java.lang.String getPageString()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 TemplateController getTemplateController()
           
abstract  void invokePage()
          This is the method that will deliver the page to the user.
 void setPageString(java.lang.String string)
           
 void setParameters(DatabaseWrapper dbWrapper, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, TemplateController templateController, DeliveryContext deliveryContext)
          The default initializer for PageInvokers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageInvoker

public PageInvoker()
Method Detail

getDecoratedPageInvoker

public abstract PageInvoker getDecoratedPageInvoker()
                                             throws SystemException
This method should return an instance of the class that should be used for page editing inside the tools or in working. Makes it possible to have an alternative to the ordinary delivery optimized class.

Throws:
SystemException

setParameters

public void setParameters(DatabaseWrapper dbWrapper,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          TemplateController templateController,
                          DeliveryContext deliveryContext)
The default initializer for PageInvokers.

Parameters:
request -
response -
templateController -
deliveryContext -

getDatabase

public org.exolab.castor.jdo.Database getDatabase()
                                           throws SystemException
Throws:
SystemException

invokePage

public abstract void invokePage()
                         throws SystemException,
                                java.lang.Exception
This is the method that will deliver the page to the user. It can have special handling of all sorts to enable all sorts of handlers. An example of uses might be to be to implement a WAP-version of page delivery where you have to set certain headers in the response or a redirect page which just redirects you to another page.

Throws:
SystemException
java.lang.Exception

deliverPage

public void deliverPage()
                 throws java.lang.Exception
This method is used to send the page out to the browser or other device. Override this if you need to set other headers or do other specialized things.

Throws:
java.lang.Exception

cachePage

public void cachePage()
This method is used to allow pagecaching on a general level.


getDeliveryContext

public final DeliveryContext getDeliveryContext()

getRequest

public final javax.servlet.http.HttpServletRequest getRequest()

getResponse

public final javax.servlet.http.HttpServletResponse getResponse()

getTemplateController

public final TemplateController getTemplateController()

getPageString

public java.lang.String getPageString()

setPageString

public void setPageString(java.lang.String string)

getDefaultContext

public java.util.Map getDefaultContext()
Creates and returns a defaultContext, currently with the templateLogic and if the portal support is enabled the portalLogic object. (Added to avoid duplication of context creation in the concrete implementations of pageInvokers)

Returns:
A default context with the templateLogic and portalLogic object in it.


Copyright © 2005 InfoGlue.org All Rights Reserved.