|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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
ComponentSpecification
).
IPageSource
,
IPageLoader
Method Summary | |
void |
addPageCleanupListener(PageCleanupListener listener)
|
void |
addPageDetachListener(PageDetachListener listener)
|
void |
addPageRenderListener(PageRenderListener listener)
|
void |
attach(IEngine value)
Attaches the page to the engine . |
void |
beginResponse(IResponseWriter writer,
IRequestCycle cycle)
Invoked just before rendering of the page is initiated. |
void |
cleanupPage()
Invoked when the application terminates (that is, when the HttpSession
containing the IEngine is invalidated or times out). |
void |
detach()
Invoked on a page when it is no longer needed by the engine, just before is is returned to the pool. |
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. |
java.util.Locale |
getLocale()
Returns the Locale of the page. |
java.lang.String |
getName()
The logical name is the name given by the application. |
IComponent |
getNestedComponent(java.lang.String path)
Returns a particular component from within the page. |
IRequestCycle |
getRequestCycle()
Returns the current IRequestCycle . |
IResponseWriter |
getResponseWriter(java.io.OutputStream out)
Invoked to create a response writer appropriate to the page (i.e., appropriate to the content of the page). |
java.lang.Object |
getVisit()
Returns the visit object for the application; the visit object contains application-specific information. |
void |
renderPage(IResponseWriter writer,
IRequestCycle cycle)
Invoked to render the entire page. |
void |
setChangeObserver(ChangeObserver value)
|
void |
setLocale(java.util.Locale value)
Updates the page's locale. |
void |
setName(java.lang.String value)
|
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 immediate services to validate that the user is allowed to visit the page. |
Methods inherited from interface com.primix.tapestry.IComponent |
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getPage, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification |
Methods inherited from interface com.primix.tapestry.IRender |
render |
Method Detail |
public void detach()
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 java.util.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(java.util.Locale value)
ApplicationRuntimeException
.public java.lang.String getName()
public IComponent getNestedComponent(java.lang.String path)
NoSuchComponentException
- 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.public void renderPage(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
IRequestCycle.renderPage(IResponseWriter writer)
.
The page performs a render using the following steps:
PageRenderListener.pageBeginRender(PageEvent)
beginResponse(IResponseWriter, IRequestCycle)
IRequestCycle.commitPageChanges()
(if not rewinding)
IRender.render(IResponseWriter, IRequestCycle)
PageRenderListener.pageEndRender(PageEvent)
(this occurs
even if a previous step throws an exception)public void setChangeObserver(ChangeObserver value)
public void setName(java.lang.String value)
public void validate(IRequestCycle cycle) throws RequestCycleException
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 thow a PageRedirectException
, to redirect the user to an appropriate
part of the system (such as, a login page).
public IResponseWriter getResponseWriter(java.io.OutputStream out)
HTMLResponseWriter
will be returned, but future enhancements may support XML, WAP,
WML, etc., and thus other implementations of IResponseWriter
will be returned.public void beginResponse(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
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 void cleanupPage()
HttpSession
containing the IEngine
is invalidated or times out). This gives
the page a chance to release any additional resources it may have ...
in particular,
it allows a page to remove stateful session EJBs it may be using.
Invokes PageCleanupListener.pageCleanup(PageEvent)
on any listeners.
public java.lang.Object getVisit()
public void addPageRenderListener(PageRenderListener listener)
public void addPageDetachListener(PageDetachListener listener)
public void addPageCleanupListener(PageCleanupListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |