Page
encapsulates all data that is attached to a site url and that can be edited in terms of composers and pagelets. All the content may also be supplied in multiple languages. During lifetime, the page keeps track of creation, modification and publishing processes. Note that a page can exist in many versions, with a few of them being special:
A {@link Page} object represents a single part of a Tabris UI. A Tabris UI consists of several {@link Page} objects.Usually a {@link Page} takes the most of the device's screen. The responsibility of a {@link Page} is to render theapplications content. Basically it's the only point where you will create widgets and other visual representations.
{@link Page} implementations will be registered by their type. This is because a page object needs to creatednewly when it's shown the first time. Let's take a look at an example:
When you create a book browsing app you will probably have a book page. In this app you will need to browse through books, right? And the big feature will be that you can browse from book to book in a chain, right? So, as a result a new book page needs to be created for every new book. But when you want to browse back to the last book it doesn't need a new page object because it already exist, right?. And this is exactly how the Tabris UI works.
NOTE: A {@link Page} needs to provide a no-argument constructor because instances will be created by theframework.
{@link Page} will be created while browsing forward through an app. But reused when you browse backwith {@link PageManager#showPreviousPage()}.
@see PageConfiguration @see PageManager @since 0.11The original data in its entirity can be written using the writePage() methods. It may also contain a set of properties - these vary among different {@link com.opensymphony.module.sitemesh.PageParser} implementations.
Typically a Page is no use to a {@link com.opensymphony.module.sitemesh.Decorator} as it needsspecific details relevant to the content-type of that page (e.g. HTML pages). The appropriate {@link com.opensymphony.module.sitemesh.PageParser} is responsiblefor returning extended implementations of pages such as {@link com.opensymphony.module.sitemesh.HTMLPage}which are of more use to the Decorator. New media types (e.g. WML) could be added to the system by extending Page and implementing an appropriate PageParser.
@author Joe Walnes @version $Revision: 1.5 $type name description --------------------------------------------------------------- byte VERSION - A byte indicating the version of this entry. String URL - The url of a page. This is the primary key. 128bit ID - The MD5 hash of the contents of the page. 64bit DATE - The date this page should be refetched. byte RETRIES - The number of times we've failed to fetch this page. byte INTERVAL - Frequency, in days, this page should be refreshed. float SCORE - Multiplied into the score for hits on this page. float NEXTSCORE - Multiplied into the score for hits on this page.@author Mike Cafarella @author Doug Cutting
A Page represents exclusive access to a data page within a container. Exclusive access is released by calling the unlatch() method, once that occurs the caller must no longer use the Page reference.
Several of the methods in Page take a RecordHandle as an argument. RecordHandles are obtained from a Page, while holding exclusive access of Page or a from a previous exclusive access of a Page representing the same data page. All RecordHandle's used as arguments to methods (with the exception of recordExists()) must be valid for the current state of the page. If they are not valid then the method will throw an exception. A caller can ensure that a record handle is valid by:
Several of the methods in Page take a slot number as an argument. A slot always correspond to a record, which may be deleted or undeleted.
MT - Latched - In general every method requires the page to be latched.
Latching
All page methods which are not valid for a latched page throw an exception if the page is not latched. [@exception clauses on all the methods should be updated to reflect this].
Aux Objects
The page cache will manage a client object along with the page as long as it remains in cache. This object is called the "aux object". The aux object is associated with the page with setAuxObject(), and can be retreived later with getAuxObject(). The aux object will remain valid as long as the page is latched, but callers cannot assume that an aux object will ever stick around once the page is unlatched. However, the page manager promises to call pageBeingEvicted() once before clearing the aux reference from the page.
@see Object
@see ContainerHandle
@see RecordHandle
@see AuxObject
type name description --------------------------------------------------------------- byte VERSION - A byte indicating the version of this entry. String URL - The url of a page. This is the primary key. 128bit ID - The MD5 hash of the contents of the page. 64bit DATE - The date this page should be refetched. byte RETRIES - The number of times we've failed to fetch this page. byte INTERVAL - Frequency, in days, this page should be refreshed. float SCORE - Multiplied into the score for hits on this page. float NEXTSCORE - Multiplied into the score for hits on this page.@author Mike Cafarella @author Doug Cutting
Page has the following differences to {@link Component}s main concepts:
Pages contain parameters and named sections. These are used by derived Page classes that implement a Look and Feel. Page users may add to name sections such as "Margin" or "Footer" and set parameters such as "HelpUrl" without knowledge of how the look and feel will arrange these. To assist with standard look and feel creation Page defines a set of standard names for many common parameters and sections.
If named sections are used, the page constructor or completeSections must add the named section to the page in the appropriate places. If named sections are not added to the page, then they can only be written with an explicit call to write(out,"section",end); Changes in behaviour to section creation and adding, should be controlled via page properties.
@see Composite @version $Id: Page.java,v 1.5 2004/09/23 02:15:15 gregwilkins Exp $ @author Greg Wilkins
This class should be subclassed by clients wishing to define new types of pages for multi-page views.
Subclasses must implement the following methods:
createControl
- to create the page's controlgetControl
- to retrieve the page's controlSubclasses may extend or reimplement the following methods as required:
dispose
- extend to provide additional cleanupsetFocus
- reimplement to accept focussetActionBars
- reimplement to make contributionsmakeContributions
- this method exists to support previous versionssetActionBars
- this method exists to support previous versionsinit
- extend to provide additional setupA page is a pointer with useful information pointing to a component structure.
Page can be organized as hierarchies used for the single purpose of performing property inheritance. The pages of a same hierarchy belong to the same site.
@author Julien Viet @version $Revision$Pages contain parameters and named sections. These are used by derived Page classes that implement a Look and Feel. Page users may add to name sections such as "Margin" or "Footer" and set parameters such as "HelpUrl" without knowledge of how the look and feel will arrange these. To assist with standard look and feel creation Page defines a set of standard names for many common parameters and sections.
If named sections are used, the page constructor or completeSections must add the named section to the page in the appropriate places. If named sections are not added to the page, then they can only be written with an explicit call to write(out,"section",end); Changes in behaviour to section creation and adding, should be controlled via page properties.
@see Composite @version $Id: Page.java,v 1.5 2004/09/23 02:15:15 gregwilkins Exp $ @author Greg Wilkins
PageClass
maintains a reference to the JSP's location within the web application folder structure, which can be accessed using getPagePath()
@author Phil Zoio
When a ZK request is asking to render a new page, a new page is created and components that are created duing this request all belong to this page.
If a ZK requst is asking an update, it must have at lease one UUID of a component ( {@link Component#getUuid}. From this UUID, we know which page it belongs and activate it to process the update.
By activation, the system guarantees no concurrent access to pages and components (so you don't need use synchronized for them).
In portal and some environments, a client request (e.g., ServletRequest) might consists of several ZK requests ( {@link org.zkoss.zk.au.AuRequest}). While each ZK request might ask to create an independent page, all these pages are grouped as a desktop, such that they are activated and removed at the same time. Moreover, pages in the same desktop could communicate to eath other (see Inter-page communication).
A session, {@link Session}, might have multiple desktops of pages, {@link Page}, while a page belongs to exactly one session. A page, {@link Page}, might have many components, {@link Component}, while a component belongs to exactly one page.
All components of the same desktop of pages are removed at the same time if a page become 'obsolete'.
During each execution (${link Execution}), exactly one desktop of pages are locked (aka., activated). Though an execution serves a client request (e.g., ServletRequest), a client request might consist of multiple ZK request ( {@link org.zkoss.zk.au.AuRequest}). Each ZK request might target to a different page (of the same desktop).
To do inter-page communication, you could do:
They are the same as handling components from the same page. However, invoking method directly for components from another page has one restriction:
It cannot create component.
@author tomyeh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|