org.scopemvc.view.servlet
Class Page

java.lang.Object
  |
  +--org.scopemvc.view.servlet.Page
All Implemented Interfaces:
View
Direct Known Subclasses:
AbstractXSLPage, JSPPage

public abstract class Page
extends java.lang.Object
implements View

Base class for views used by servlet implementation.

Pages in a browser do not communicate with the web server, so this class does not implement ModelChangeListener. Model objects in a web application shouldn't bother to implement ModelChangeEventSource unless change notification is used for some purpose other than updating Views.

In a servlet application, a Controller must use a ServletView that contains all possible Pages that the Controller can show.

Pages must be created with unique View IDs to allow incoming requests to be linked to the correct parent View instance in ScopeServlet. eg

http://localhost/scope/servlet/Test?view=TestView&action=TestControl
causes the View with ID "TestView" to issue a Control whose ID is "TestControl".

The concrete implementation will need to support the appropriate ViewContext: for example a JSPPage is tailored for use by the JSPContext whereas a ServletXSLPage offers a different API to the XSLServletContext.

Version:
$Revision: 1.9 $ $Date: 2002/09/05 15:41:50 $
Author:
Steve Meyfroidt

Constructor Summary
protected Page(java.lang.String inViewID)
          Create with a unique ID.
 
Method Summary
 boolean equalsID(java.lang.String inID)
          TODO: document the method
 java.lang.Object getBoundModel()
          Gets the bound model
 Controller getController()
          Gets the controller
 java.lang.String getID()
          Gets the ID
 ServletView getParent()
          Gets the parent
 void issueControl(Control inControl)
          Issue Control via the parent ServletView.
 java.util.List populateModel(java.util.HashMap inParameters)
           Called from ScopeServlet.doPost.
 void setBoundModel(java.lang.Object inModel)
          Parent ServletView is bound to a model, not each Page.
 void setController(Controller inController)
          Parent ServletView has a Controller, not each Page.
 void setParent(ServletView inServletView)
          Sets the parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Page

protected Page(java.lang.String inViewID)
Create with a unique ID.

Parameters:
inViewID - TODO: Describe the Parameter
Method Detail

getID

public final java.lang.String getID()
Gets the ID

Returns:
The iD value

getParent

public final ServletView getParent()
Gets the parent

Returns:
The parent value

getBoundModel

public final java.lang.Object getBoundModel()
Gets the bound model

Specified by:
getBoundModel in interface View
Returns:
The boundModel value

getController

public final Controller getController()
Gets the controller

Specified by:
getController in interface View
Returns:
The controller value

issueControl

public void issueControl(Control inControl)
Issue Control via the parent ServletView.

Specified by:
issueControl in interface View
Parameters:
inControl - TODO: Describe the Parameter

setParent

public final void setParent(ServletView inServletView)
Sets the parent

Parameters:
inServletView - The new parent value

setBoundModel

public final void setBoundModel(java.lang.Object inModel)
Parent ServletView is bound to a model, not each Page.

Specified by:
setBoundModel in interface View
Parameters:
inModel - The new boundModel value

setController

public final void setController(Controller inController)
Parent ServletView has a Controller, not each Page.

Specified by:
setController in interface View
Parameters:
inController - The new controller value

equalsID

public final boolean equalsID(java.lang.String inID)
TODO: document the method

Parameters:
inID - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

populateModel

public java.util.List populateModel(java.util.HashMap inParameters)

Called from ScopeServlet.doPost.

Implementing this method is optional -- Pages don't have to support population of their model. The default implementation here does nothing.

Parameters:
inParameters - TODO: Describe the Parameter
Returns:
List list of ValidationFailures or null if none


Copyright © 2000-2002 The Scope Team. All Rights Reserved.