|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPageVersionManager
An interface that manages versions of a Page
. Initially a page has a version number
of 0, indicating that it is in its original state. When one or more changes are made to the page,
we arrive at version 1.
During a RequestCycle
, just before a change is about to occur, the
beginVersion
method is called, followed by one or more calls to
componentAdded
, componentRemoved
or componentModelChanging
. If beginVersion
is called by the framework during a given request cycle, a
balancing call to endVersion
will occur at the end of the request cycle. However, if
no changes occur to a page during a request cycle, none of these methods will be called.
Once version information has been added to a page version manager (
IPageVersionManager
), versions can be retrieved by number using the
getVersion(int)
method. Since version 0 is the first version of a page, calling
getVersion(0)
will retrieve that version.
The current version number of a page (that is, the number of the newest available version) can be
retrieved by calling getCurrentVersionNumber
.
Method Summary | |
---|---|
void |
beginVersion(boolean mergeVersion)
Called when changes are immediately impending to the Page being managed. |
void |
componentAdded(Component component)
Indicates that the given Component was added. |
void |
componentModelChanging(Component component)
Indicates that the model for the given Component is about to change. |
void |
componentRemoved(Component component)
Indicates that the given Component was removed. |
void |
componentStateChanging(Change change)
Indicates an internal state for the given Component is about to change. |
void |
endVersion(boolean mergeVersion)
Called when changes to the Page have ended. |
void |
expireOldestVersion()
Expires oldest version in this page version manager. |
int |
getAjaxVersionNumber()
Retrieves the current Ajax version number. |
int |
getCurrentVersionNumber()
Retrieves the newest version number available in this page version manager. |
Page |
getVersion(int versionNumber)
Retrieves a given Page version. |
int |
getVersions()
Retrieves the number of versions stored in this page version manager. |
void |
ignoreVersionMerge()
Call this method if the current Ajax request shouldn't merge changes that are happening to the Page with the previous version. |
Page |
rollbackPage(int numberOfVersions)
Rolls back the Page by the number of versions specified, including the Ajax
versions. |
Method Detail |
---|
void beginVersion(boolean mergeVersion)
Page
being managed. The
changes to the page between the call to this method and the call to endVersion
create a new version of the page.
In requests where a page is not changed at all, beginVersion
will never be
called, nor will any of the other methods in this interface.
mergeVersion
- If this is set, the version that was created is merged with the previous one.void componentAdded(Component component)
Component
was added.
component
- the Component
that was addedvoid componentModelChanging(Component component)
Component
is about to change.
component
- the Component
whose model is about to changevoid componentStateChanging(Change change)
Component
is about to change.
change
- the Change
which represents the internal statevoid componentRemoved(Component component)
Component
was removed.
component
- the Component
that was removedvoid endVersion(boolean mergeVersion)
Page
have ended.
mergeVersion
- If this is set, the version that was created is merged with the previous one.beginVersion(boolean)
void expireOldestVersion()
Page getVersion(int versionNumber)
Page
version. This method does not include the Ajax versions.
versionNumber
- the version of the page to get
Page
, or null
if the version requested is not availablePage rollbackPage(int numberOfVersions)
Page
by the number of versions specified, including the Ajax
versions.
numberOfVersions
- the number of versions to roll back
Page
int getVersions()
IPageVersionManager
int getCurrentVersionNumber()
IPageVersionManager
int getAjaxVersionNumber()
void ignoreVersionMerge()
Page
with the previous version. This is needed, for example, when you want
to redirect to this page in an Ajax request, and then you want to version normally.
This method should only be called if the beginVersion
method was called with
true
!
beginVersion(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |