com.sapportals.htmlb.page

Class DynPage

java.lang.Object
  extended bycom.sapportals.htmlb.page.DynPage

public abstract class DynPage
extends Object

Base class for pages. This class does some rudimentary event handling by invoking appropriate methods.

Copyright 2004 SAP AG


Field Summary
protected  Document document
           
protected  Form form
           
protected  String forward
           
protected  String title
           
 
Constructor Summary
DynPage()
          creates a new DynPage.
 
Method Summary
abstract  void doInitialization()
          initialize your DynPage.
 void doOutput(com.sapportals.htmlb.page.PageProcessor processor)
          actually do your output.
abstract  void doProcessAfterInput()
          Process any user input.
abstract  void doProcessBeforeOutput()
          preprocess your output.
 void doProcessCurrentEvent(Event theEvent)
          processes the current event by invoking a method with an appropriate name and signature.
 void doSetupOutput()
          sets up the output for this DynPage.
 ClassLoader getClassLoader()
          Get the actual classloader object.
 Component getComponentByName(String name)
           
 Component[] getComponents()
          gets an array of all components from the last submitted form or null if there were no components
 Document getDocument()
          returns the Document object of the page
 Form getForm()
          gets the Form to be used in this DynPage.
 String getForward()
           
 IPageContext getPageContext()
          gets the IPageContext of the current request.
protected  Object getRequest()
           
protected  Object getResponse()
           
 String getTitle()
           
 void setClassLoader(ClassLoader classLoader)
          Set the classloader to use.
 void setComponents(Component[] components)
          Deprecated.  
 void setForm(Form form)
          sets the Form to be used in this DynPage.
 void setForward(String url)
          set forward url e.g.
 void setPageContext(IPageContext pageContext)
          Set the IPageContext of the current request.
 void setRequest(Object request)
          Sets the request object.
 void setResponse(Object response)
          Set the response object.
 void setTitle(String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected Document document

form

protected Form form

title

protected String title

forward

protected String forward
Constructor Detail

DynPage

public DynPage()
creates a new DynPage. Subclasses should use setTitle() in their own constructors to set a title for the generated document.

Method Detail

doSetupOutput

public void doSetupOutput()
                   throws PageException
sets up the output for this DynPage. The default implementation creates a document and sets up a Form that you can access using the getForm() method. Note that this method is called first, i.e. before any input processing or event handling!

You may want to override this method if you do not process output directly, e.g. if you use JSPs to render the output in which case you might setup your data beans.

Throws:
PageException

doInitialization

public abstract void doInitialization()
                               throws PageException
initialize your DynPage. This method is called the first time your MiniApp is invoked.

Throws:
PageException

doProcessAfterInput

public abstract void doProcessAfterInput()
                                  throws PageException
Process any user input.

Throws:
PageException

doProcessCurrentEvent

public void doProcessCurrentEvent(Event theEvent)
                           throws PageException
processes the current event by invoking a method with an appropriate name and signature.

'appropriate' means that we look for a method with the name of the event action and a single Event parameter. If no such method exists we try to prefix the event action with 'on' and capitalize the first letter. E.g. if the event action is 'submit' we first try to invoke a method

 public void submit(Event event) {}
 
if no such method exists, we try to invoke
 public void onSubmit(Event event) {}
 
If there is no such method either a PageException is thrown.

Subclasses may override this method to install their own event handling.

Parameters:
theEvent - the current event from the PageContext
Throws:
PageException

doProcessBeforeOutput

public abstract void doProcessBeforeOutput()
                                    throws PageException
preprocess your output. You can set up a component tree in this method and add it to your current form.

Throws:
PageException

doOutput

public void doOutput(com.sapportals.htmlb.page.PageProcessor processor)
              throws PageException
actually do your output. If you do not want to do any output yourself you can override this method to include JSPs in your output or redirect the request or ...

Throws:
PageException

setForm

public void setForm(Form form)
sets the Form to be used in this DynPage.

Parameters:
form - the Form to be used

getForm

public Form getForm()
gets the Form to be used in this DynPage.

Returns:
the Form to be used

setRequest

public void setRequest(Object request)
Sets the request object.


getRequest

protected Object getRequest()
Returns:
the current request object. The class of the object depends on the environment, e.g. HttpServletRequest in a servlet environment or IPortalComponentRequest in Workplace environment.

setResponse

public void setResponse(Object response)
Set the response object.


getResponse

protected Object getResponse()
Returns:
the current response object. The class of the object depends on the environment, e.g. HttpServletResponse in a servlet environment or IPortalComponentResponse in Workplace environment.

getPageContext

public IPageContext getPageContext()
gets the IPageContext of the current request.

Returns:
the current IPageContext

setPageContext

public void setPageContext(IPageContext pageContext)
Set the IPageContext of the current request.


getComponents

public Component[] getComponents()
gets an array of all components from the last submitted form or null if there were no components

Returns:
an array of components

setComponents

public void setComponents(Component[] components)
Deprecated.  


getComponentByName

public Component getComponentByName(String name)

setTitle

public void setTitle(String title)

getTitle

public String getTitle()

getDocument

public Document getDocument()
returns the Document object of the page


setForward

public void setForward(String url)
set forward url e.g. /webapp/myJSP.jsp


getForward

public String getForward()

getClassLoader

public ClassLoader getClassLoader()
Get the actual classloader object.


setClassLoader

public void setClassLoader(ClassLoader classLoader)
Set the classloader to use.



Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.