|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPage
A root level component responsible for generating an entire a page within the application.
Pages are created dynamically from their class names (part of the
IComponentSpecification
).
IPageSource
,
IPageLoader
Method Summary | |
---|---|
void |
addPageAttachListener(PageAttachListener listener)
|
void |
addPageBeginRenderListener(PageBeginRenderListener listener)
|
void |
addPageDetachListener(PageDetachListener listener)
|
void |
addPageEndRenderListener(PageEndRenderListener listener)
|
void |
addPageValidateListener(PageValidateListener listener)
|
void |
attach(IEngine engine,
IRequestCycle cycle)
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 |
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). |
void |
firePageAttached()
Used to explicitly fire PageAttachListener s for this 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. |
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. |
PropertyChangeObserver |
getPropertyChangeObserver()
Returns the injected property change service responsible for monitoring changes to individual object properties being persisted. |
IRequestCycle |
getRequestCycle()
Returns the current IRequestCycle . |
ContentType |
getResponseContentType()
Invoked to obtain the content type to be used for the response. |
boolean |
hasFormComponents()
Whether or not this page contains IForm instances. |
boolean |
hasWidgets()
Whether or not this page contains IWidget instances. |
void |
removePageAttachListener(PageAttachListener listener)
|
void |
removePageBeginRenderListener(PageBeginRenderListener listener)
|
void |
removePageDetachListener(PageDetachListener listener)
|
void |
removePageEndRenderListener(PageEndRenderListener listener)
|
void |
removePageValidateListener(PageValidateListener listener)
|
void |
renderPage(ResponseBuilder builder,
IRequestCycle cycle)
Invoked to render the entire page. |
void |
setChangeObserver(ChangeObserver value)
|
void |
setHasFormComponents(boolean value)
Sets whether or not page has forms. |
void |
setHasWidgets(boolean value)
Sets whether or not page has widgets. |
void |
setLocale(Locale value)
Updates the page's locale. |
void |
setPageName(String pageName)
Sets the name of the page. |
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, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName |
Methods inherited from interface org.apache.tapestry.IRender |
---|
render |
Methods inherited from interface org.apache.hivemind.LocationHolder |
---|
setLocation |
Methods inherited from interface org.apache.hivemind.Locatable |
---|
getLocation |
Method Detail |
---|
void detach()
Classes should also reset any properties to default values (as if the instance was freshly instantiated).
IPageSource.releasePage(IPage)
IEngine getEngine()
IEngine
that the page is currently attached to.
ChangeObserver getChangeObserver()
IPageRecorder
) that
is notified of any changes to persistant properties of the page.
PropertyChangeObserver getPropertyChangeObserver()
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.
void setLocale(Locale value)
ApplicationRuntimeException
.
String getPageName()
void setPageName(String pageName)
pageName
- fully qualified page name (including namespace prefix, if any)IComponent getNestedComponent(String path)
org.apache.hivemind.ApplicationRuntimeException
- runtime exception thrown if the path does not identify a component.void attach(IEngine engine, IRequestCycle cycle)
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 will notify any PageAttachListener
s.
This method is rarely overriden; to initialize page properties before a render, implement the
PageBeginRenderListener
interface.
void firePageAttached()
PageAttachListener
s for this page. This is used when a page
is first loaded; The page loader attaches the newly created page instance before
the rest of the page and components is loaded. In order to have meaningful event
notifications when a page is first loaded (rather than pulled from the pool), it is necessary
to fire page attach listeners at the end of the load.
void renderPage(ResponseBuilder builder, IRequestCycle cycle)
IRequestCycle.renderPage(ResponseBuilder builder)
.
The page performs a render using the following steps:
PageBeginRenderListener.pageBeginRender(org.apache.tapestry.event.PageEvent)
beginPageRender()
IRequestCycle.commitPageChanges()
(if not rewinding)
IRender.render(IMarkupWriter, IRequestCycle)
PageEndRenderListener.pageEndRender(org.apache.tapestry.event.PageEvent)
(this occurs even if a previous step throws an exception).
void beginPageRender()
Form
within the page). The page is expected to fire
appopriate events.
void endPageRender()
Form
within the page). The page is expected to fire
appropriate events.
void setChangeObserver(ChangeObserver value)
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.
ContentType getResponseContentType()
IRequestCycle getRequestCycle()
IRequestCycle
. This is set when the page is loaded (or obtained
from the pool) and attached to the engine
.
boolean hasFormComponents()
IForm
instances.
void setHasFormComponents(boolean value)
value
- Indicator of containing forms.boolean hasWidgets()
IWidget
instances.
void setHasWidgets(boolean value)
value
- Indicator of containing widgets.void addPageBeginRenderListener(PageBeginRenderListener listener)
void removePageBeginRenderListener(PageBeginRenderListener listener)
void addPageEndRenderListener(PageEndRenderListener listener)
void removePageEndRenderListener(PageEndRenderListener listener)
void addPageDetachListener(PageDetachListener listener)
void removePageDetachListener(PageDetachListener listener)
void addPageValidateListener(PageValidateListener listener)
void removePageValidateListener(PageValidateListener listener)
void addPageAttachListener(PageAttachListener listener)
void removePageAttachListener(PageAttachListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |