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
-
anchor
- The anchor text for this page (short)
-
children
- The children of this page
-
identifier
- The internal identifier for this page
-
parent
- The parent of this page
-
role
- The role authorized to view this page
-
title
- The title of this page
-
Page(String, Page, String, Role, String)
- Constructor
-
addChild(Page)
- Add a page as a child of this page.
-
addChildren(Page[])
- Add a list of children
-
emitForm(View)
- Return an html form command to this page as a string
-
emitForm(View, String[], Validatable[])
- Return an html form command for accessing this page as a string.
-
emitLink(View, String)
- Return an html anchor command that when clicked, will invoke
this page.
-
emitLink(View, String, String[], Validatable[])
- Return an html anchor command that when clicked, will invoke
this page.
-
getAnchor()
- Return the anchor string for this page
-
getChildren()
- Return the children of this page as a Vector.
-
getDepth()
- Return the depth of this page in the child-parent tree.
-
getIdentifier()
- Return the identifier of this page
-
getParent()
- Return the parent of this page or null if none.
-
getRelativePath(Site)
- Abstract method overridden by subclasses to return the absolute
path of this page relative to the servlet context.
-
getRole()
- Return the role allowed to access this page
-
getTitle()
- Return the title of this page
-
isDescendedFrom(Page)
- Is page the same as or descended from this page?
-
setParent(Page)
- Set the parent of this page.
-
toString()
- Return the identifier as a printable representation of this state.
identifier
protected String identifier
- The internal identifier for this page
anchor
protected String anchor
- The anchor text for this page (short)
role
protected Role role
- The role authorized to view this page
title
protected String title
- The title of this page
parent
protected Page parent
- The parent of this page
children
protected final Vector children
- The children of this page
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.
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.
addChildren
public void addChildren(Page list[])
- Add a list of children
- Parameters:
- Page[] - list: The child pages to be added.
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.
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
emitLink
public String emitLink(View view,
String dynamicAnchor)
- Return an html anchor command that when clicked, will invoke
this page.
emitLink
public String emitLink(View view,
String anchor,
String argNames[],
Validatable argValues[])
- Return an html anchor command that when clicked, will invoke
this page.
getAnchor
public String getAnchor()
- Return the anchor string for this page
- Returns:
- s String
getChildren
public Vector getChildren()
- Return the children of this page as a Vector.
- Returns:
- s Vector
getDepth
public int getDepth()
- Return the depth of this page in the child-parent tree.
getIdentifier
public String getIdentifier()
- Return the identifier of this page
- Returns:
- s Identifier
getParent
public Page getParent()
- Return the parent of this page or null if none.
- Returns:
- s Page
getRelativePath
abstract String getRelativePath(Site site)
- Abstract method overridden by subclasses to return the absolute
path of this page relative to the servlet context.
getRole
public Role getRole()
- Return the role allowed to access this page
- Returns:
- s Role
getTitle
public String getTitle()
- Return the title of this page
- Returns:
- s String
isDescendedFrom
public boolean isDescendedFrom(Page page)
- Is page the same as or descended from this page?
- Returns:
- s boolean
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.
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