|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A root level component responsible for generating an entire a page within the application.
Pages are created dynamically from thier class names (part of the
IComponentSpecification
).
IPageSource
,
IPageLoader
Method Summary | |
void |
addPageDetachListener(PageDetachListener listener)
|
void |
addPageRenderListener(PageRenderListener listener)
|
void |
addPageValidateListener(PageValidateListener listener)
|
void |
attach(IEngine value)
Attaches the page to the engine . |
void |
beginPageRender()
Invoked before a partial render of the page occurs (this happens when rewinding a Form
within the page). |
void |
beginResponse(IMarkupWriter writer,
IRequestCycle cycle)
Invoked just before rendering of the page is initiated. |
void |
detach()
Invoked on a page when it is no longer needed by the engine, just before is is returned to the pool. |
void |
endPageRender()
Invoked after a partial render of the page occurs (this happens when rewinding a Form
within the page). |
ChangeObserver |
getChangeObserver()
Returns the object (effectively, an IPageRecorder ) that is notified
of any changes to persistant properties of the page. |
IEngine |
getEngine()
Returns the IEngine that the page is currently
attached to. |
Object |
getGlobal()
Returns the globally shared application object. |
Locale |
getLocale()
Returns the Locale of the page. |
IComponent |
getNestedComponent(String path)
Returns a particular component from within the page. |
String |
getPageName()
Returns the fully qualified name of the page, including its namespace prefix, if any. |
IRequestCycle |
getRequestCycle()
Returns the current IRequestCycle . |
IMarkupWriter |
getResponseWriter(OutputStream out)
Invoked to create a response writer appropriate to the page (i.e., appropriate to the content of the page). |
Object |
getVisit()
Returns the visit object for the application; the visit object contains application-specific information. |
void |
removePageDetachListener(PageDetachListener listener)
|
void |
removePageRenderListener(PageRenderListener listener)
|
void |
removePageValidateListener(PageValidateListener listener)
|
void |
renderPage(IMarkupWriter writer,
IRequestCycle cycle)
Invoked to render the entire page. |
void |
setChangeObserver(ChangeObserver value)
|
void |
setLocale(Locale value)
Updates the page's locale. |
void |
setPageName(String pageName)
Sets the name of the page. |
void |
setRequestCycle(IRequestCycle cycle)
Invoked by the IRequestCycle to inform the page of the cycle,
as it is loaded. |
void |
validate(IRequestCycle cycle)
Method invoked by the page, action and direct services to validate that the user is allowed to visit the page. |
Methods inherited from interface org.apache.tapestry.IComponent |
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification |
Methods inherited from interface org.apache.tapestry.IRender |
render |
Methods inherited from interface org.apache.tapestry.ILocationHolder |
setLocation |
Methods inherited from interface org.apache.tapestry.ILocatable |
getLocation |
Method Detail |
public void detach()
Classes should also reset any properties to default values (as if the instance was freshly instantiated).
IPageSource.releasePage(IPage)
public IEngine getEngine()
IEngine
that the page is currently
attached to.
public ChangeObserver getChangeObserver()
IPageRecorder
) that is notified
of any changes to persistant properties of the page.
public Locale getLocale()
Locale
of the page.
The locale may be used to determine what template is
used by the page and the components contained by the page.
public void setLocale(Locale value)
ApplicationRuntimeException
.
public String getPageName()
public void setPageName(String pageName)
pageName
- fully qualified page name (including namespace prefix, if any)public IComponent getNestedComponent(String path)
ApplicationRuntimeException
- runtime exception
thrown if the path does not identify a component.public void attach(IEngine value)
engine
.
This method is used when a pooled page is
claimed for use with a particular engine; it will stay attached
to the engine until the end of the current request cycle,
then be returned to the pool.
This method is rarely overriden; to initialize
page properties before a render, override
beginResponse(IMarkupWriter, IRequestCycle)
.
public void renderPage(IMarkupWriter writer, IRequestCycle cycle)
IRequestCycle.renderPage(IMarkupWriter writer)
.
The page performs a render using the following steps:
PageRenderListener.pageBeginRender(org.apache.tapestry.event.PageEvent)
beginResponse(IMarkupWriter, IRequestCycle)
IRequestCycle.commitPageChanges()
(if not rewinding)
IRender.render(IMarkupWriter, IRequestCycle)
PageRenderListener.pageEndRender(org.apache.tapestry.event.PageEvent)
(this occurs
even if a previous step throws an exception).
public void beginPageRender()
Form
within the page). The page is expected to fire appopriate
events.
public void endPageRender()
Form
within the page). The page is expected to fire
appropriate events.
public void setChangeObserver(ChangeObserver value)
public void validate(IRequestCycle cycle)
Most web applications have a concept of 'logging in' and pages that an anonymous (not logged in) user should not be able to visit directly. This method acts as the first line of defense against a malicous user hacking URLs.
Pages that should be protected will typically throw a PageRedirectException
, to redirect the user to an appropriate
part of the system (such as, a login page).
Since 3.0, it is easiest to not override this method,
but to implement the PageValidateListener
interface
instead.
public IMarkupWriter getResponseWriter(OutputStream out)
public void beginResponse(IMarkupWriter writer, IRequestCycle cycle)
The timing of this explicitly before page recorder
changes are committed. Rendering occurs after the recorders
are committed, when it is too late to make changes to dynamic page
properties.
public IRequestCycle getRequestCycle()
IRequestCycle
. This is set when the
page is loaded (or obtained from the pool) and attached to the
engine
.
public void setRequestCycle(IRequestCycle cycle)
IRequestCycle
to inform the page of the cycle,
as it is loaded.
public Object getVisit()
public Object getGlobal()
Returns the global object, if it exists, or null if not defined.
public void addPageRenderListener(PageRenderListener listener)
public void removePageRenderListener(PageRenderListener listener)
public void addPageDetachListener(PageDetachListener listener)
public void removePageDetachListener(PageDetachListener listener)
public void addPageValidateListener(PageValidateListener listener)
public void removePageValidateListener(PageValidateListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |