All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sdi.wap.Page

java.lang.Object
   |
   +----com.sdi.wap.Page

public abstract class Page
extends Object
The abstract superclass of all web pages within a system. This class organizes web pages according to their hierarchy as perceived by the user (via the parent/children variables), and defines textual information (identifier, anchor, title) from which the Site.htmlPageOpen method may use to generate navigational menus.

Author:
Brad Cox; bcox@virtualschool.edu
See Also:
State, StaticPage, DynamicPage, Site

Variable Index

 o anchor
The anchor text for this page (short)
 o children
The children of this page
 o identifier
The internal identifier for this page
 o parent
The parent of this page
 o role
The role authorized to view this page
 o title
The title of this page

Constructor Index

 o Page(String, Page, String, Role, String)
Constructor

Method Index

 o addChild(Page)
Add a page as a child of this page.
 o addChildren(Page[])
Add a list of children
 o emitForm(View)
Return an html form command to this page as a string
 o emitForm(View, String[], Validatable[])
Return an html form command for accessing this page as a string.
 o emitLink(View, String)
Return an html anchor command that when clicked, will invoke this page.
 o emitLink(View, String, String[], Validatable[])
Return an html anchor command that when clicked, will invoke this page.
 o getAnchor()
Return the anchor string for this page
 o getChildren()
Return the children of this page as a Vector.
 o getDepth()
Return the depth of this page in the child-parent tree.
 o getIdentifier()
Return the identifier of this page
 o getParent()
Return the parent of this page or null if none.
 o getRelativePath(Site)
Abstract method overridden by subclasses to return the absolute path of this page relative to the servlet context.
 o getRole()
Return the role allowed to access this page
 o getTitle()
Return the title of this page
 o isDescendedFrom(Page)
Is page the same as or descended from this page?
 o setParent(Page)
Set the parent of this page.
 o toString()
Return the identifier as a printable representation of this state.

Variables

 o identifier
 protected String identifier
The internal identifier for this page

 o anchor
 protected String anchor
The anchor text for this page (short)

 o role
 protected Role role
The role authorized to view this page

 o title
 protected String title
The title of this page

 o parent
 protected Page parent
The parent of this page

 o children
 protected final Vector children
The children of this page

Constructors

 o Page
 public Page(String identifier,
             Page parent,
             String anchor,
             Role role,
             String title)
Constructor

Parameters:
String - identifier: The indentifier that Servlet uses to look up pages based on the op= parameter.

Notice that the parent-child tree is not built by this constructor. but is handled separately by the addChild() methods.

eter - Site site: the website that this page belongs to
eter - String anchor: A string that PageUtil uses as a clickable link in the navigation bar at the top of each screen.
eter - Role role: The role that is allowed to to access this page.
eter - String title: The string to be attached to each anchor as a title= argument.

Methods

 o addChild
 public void addChild(Page page)
Add a page as a child of this page. Children pages are pages that are accessible from a given page.

 o addChildren
 public void addChildren(Page list[])
Add a list of children

Parameters:
Page[] - list: The child pages to be added.
 o emitForm
 public String emitForm(View view)
Return an html form command to this page as a string

Parameters:
View - view provides access to the executable context needed to do url-encoding for sessions.
 o emitForm
 public String emitForm(View view,
                        String argNames[],
                        Validatable argValues[])
Return an html form command for accessing this page as a string. The argument list will be emitted in
Parameters:
View - view: provides access to the execution context, particularly the response object, which is used to url-encode session information for browsers that don't support cookies.
String[] - argNames: the names of any arguments to be url-encoded into the form command.
Field[] - argValues: the values of any arguments to be url-encoded into the form command.
 o emitLink
 public String emitLink(View view,
                        String dynamicAnchor)
Return an html anchor command that when clicked, will invoke this page.

 o emitLink
 public String emitLink(View view,
                        String anchor,
                        String argNames[],
                        Validatable argValues[])
Return an html anchor command that when clicked, will invoke this page.

 o getAnchor
 public String getAnchor()
Return the anchor string for this page

Returns:
s String
 o getChildren
 public Vector getChildren()
Return the children of this page as a Vector.

Returns:
s Vector
 o getDepth
 public int getDepth()
Return the depth of this page in the child-parent tree.

 o getIdentifier
 public String getIdentifier()
Return the identifier of this page

Returns:
s Identifier
 o getParent
 public Page getParent()
Return the parent of this page or null if none.

Returns:
s Page
 o getRelativePath
 abstract String getRelativePath(Site site)
Abstract method overridden by subclasses to return the absolute path of this page relative to the servlet context.

 o getRole
 public Role getRole()
Return the role allowed to access this page

Returns:
s Role
 o getTitle
 public String getTitle()
Return the title of this page

Returns:
s String
 o isDescendedFrom
 public boolean isDescendedFrom(Page page)
Is page the same as or descended from this page?

Returns:
s boolean
 o setParent
 private void setParent(Page newParent)
Set the parent of this page.

Parameters:
Page - newParent: The page this page is to be a child of.
 o toString
 public String toString()
Return the identifier as a printable representation of this state.

Returns:
s String
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index