Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet
Class Page

java.lang.Object
  |
  +--oracle.cabo.servlet.Page
All Implemented Interfaces:
java.lang.Cloneable

public class Page
extends java.lang.Object
implements java.lang.Cloneable

Identifies a single page in an application. All characters are allowable in the names and page properties, with the following exceptions:

Developers refer requests to a Page by using the UIX Controller's PageEncoder API, which transforms URLs back into Pages. Most often, developers will want their application to always submit forms and send events back to the same Page that was used for rendering. This is especially easy; PageEncoder.getDefaultURL() will return exactly this URL.

Page objects directly support the State architecture. Clients can use the BajaContext to get a StateManager, then create State objects, and set those State objects on a Page instance. Any requests back to that Page will have the State object already attached (if the State object hasn't expired in the meantime).

See Also:
PageEncoder, State

Constructor Summary
Page(Page referencePage, java.lang.String name)
          Creates a sibling Page.
Page(Page referencePage, java.lang.String name, java.util.Dictionary properties)
          Creates a sibling Page.
Page(java.lang.String name)
          Creates a Page object with the given name.
Page(java.lang.String name, java.util.Dictionary properties)
          Creates a Page object with the given name and a full set of properties.
 
Method Summary
 void clearProperties()
          Removes all properties from a page.
 java.lang.Object clone()
          Clones the page object.
 void copyIntoSelf(Page page)
          Replaces all the values of this Page object with the values in another.
 boolean equals(java.lang.Object o)
          Compares two Objects for equality.
 boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
          Gets a property of the page.
 java.lang.String getFullName(PageEncoder encoder)
          Returns the full name of the page, including all the parameters in encoded form.
 java.lang.String getName()
          Gets the name of the page.
 java.util.Dictionary getProperties()
          Returns a map of all the properties of this page.
 java.lang.String getProperty(java.lang.String key)
          Gets a property of the page.
 PageEvent getPropertyAsEvent(Page source, java.lang.String key)
          Returns a PageEvent object stored as a property as the page.
 Page getPropertyAsPage(java.lang.String key, PageDecoder decoder)
          Returns a Page object stored as a property of the page.
 State getState()
          Gets the State object attached to the Page.
 int hashCode()
          Returns a hash code value for the object.
 void setBooleanProperty(java.lang.String key, boolean value)
          Sets a boolean property on the page.
 void setName(Page basePage, java.lang.String name)
          Sets the name of the page relative to another page.
 void setName(java.lang.String name)
          Sets the name of the page.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a property on the page.
 void setPropertyAsEvent(java.lang.String key, PageEvent event)
          Sets a PageEvent object as a property on the page.
 void setPropertyAsPage(java.lang.String key, Page page, PageEncoder encoder)
          Sets a Page object as a property on the page.
 void setState(State state)
          Sets the State object attached to the Page.
 java.lang.String toString()
          Converts the page to a string.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Page

public Page(java.lang.String name)
Creates a Page object with the given name.

Page

public Page(java.lang.String name,
            java.util.Dictionary properties)
Creates a Page object with the given name and a full set of properties.

Page

public Page(Page referencePage,
            java.lang.String name,
            java.util.Dictionary properties)
Creates a sibling Page. A sibling page is one that is in the same directory as a given reference page. If the new page name starts with a forward slash ('/') it will be considered an absolute path, so the first slash will be removed and the reference page ignored. In addition, the new page name may start with any number of "../" elements, each of which will walk one level up the page directory hierarchy.

Parameters:
referencePage - the page name from which to pull the path
name - the new page name
properties - the new page is created with this full set of properties.

Page

public Page(Page referencePage,
            java.lang.String name)
Creates a sibling Page. A sibling page is one that is in the same directory as a given reference page. If the new page name starts with a forward slash ('/') it will be considered an absolute path, so the first slash will be removed and the reference page ignored. In addition, the new page name may start with any number of "../" elements, each of which will walk one level up the page directory hierarchy.

Parameters:
referencePage - the page name from which to pull the path
name - the new page name
Method Detail

getName

public java.lang.String getName()
Gets the name of the page.

setName

public void setName(java.lang.String name)
Sets the name of the page.

setName

public void setName(Page basePage,
                    java.lang.String name)
Sets the name of the page relative to another page.

getState

public State getState()
Gets the State object attached to the Page.

setState

public void setState(State state)
Sets the State object attached to the Page. Warning: The State object must have been created by the StateManager attached to the current BajaContext. Otherwise, the State cannot be encoded and will not be available on subsequent requests.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets a property on the page. The value and key can each contain any characters, and will be encoded and decoded as necessary.
Parameters:
key - the property key
value - the property value; if null, the property will be removed.

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets a property of the page.
Returns:
the property for the given key; null if the property hasn't been set on this page.

setBooleanProperty

public void setBooleanProperty(java.lang.String key,
                               boolean value)
Sets a boolean property on the page.
Parameters:
key - the property key
value - the property value

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key,
                                  boolean defaultValue)
Gets a property of the page.
Parameters:
key - the property key
defaultValue - the default value; if the property has not been set, this value will be returned
Returns:
the property for the given key; null if the property hasn't been set on this page.

getProperties

public java.util.Dictionary getProperties()
Returns a map of all the properties of this page. The instance returned is unmodifiable.

setPropertyAsPage

public void setPropertyAsPage(java.lang.String key,
                              Page page,
                              PageEncoder encoder)
Sets a Page object as a property on the page.
Parameters:
key - the property key
page - a page object
encoder - a PageEncoder implementation

setPropertyAsEvent

public void setPropertyAsEvent(java.lang.String key,
                               PageEvent event)
Sets a PageEvent object as a property on the page.
Parameters:
key - the property key
event - a PageEvent object

getPropertyAsPage

public Page getPropertyAsPage(java.lang.String key,
                              PageDecoder decoder)
Returns a Page object stored as a property of the page.
Returns:
the page for the given key; null if the property hasn't been set on this page.

getPropertyAsEvent

public PageEvent getPropertyAsEvent(Page source,
                                    java.lang.String key)
Returns a PageEvent object stored as a property as the page.
Parameters:
source - The Page which is the source of the PageEvent
key - The key of the event property
Returns:
the PageEvent for the given key; null if the property hasn't been set on this page.

clearProperties

public void clearProperties()
Removes all properties from a page.

getFullName

public java.lang.String getFullName(PageEncoder encoder)
Returns the full name of the page, including all the parameters in encoded form.

clone

public java.lang.Object clone()
Clones the page object.
Overrides:
clone in class java.lang.Object

copyIntoSelf

public void copyIntoSelf(Page page)
Replaces all the values of this Page object with the values in another. This includes the page name, the page state, and all the page properties. This method can be useful when recycling Page objects.

equals

public boolean equals(java.lang.Object o)
Compares two Objects for equality.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Converts the page to a string.
Overrides:
toString in class java.lang.Object

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.