|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IPageVersionManager
Interface to code 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 request cycle, just before a change is about to occur, beginVersion() 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 endVersion() call 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 version manager, versions can be retrieved by number using getVersion(int). Since version 0 is the first version of a page, calling getVersion(0) will retrieve that version.
The current version number (the number of the newest available version) of a page 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 |
int |
getAjaxVersionNumber()
|
int |
getCurrentVersionNumber()
|
Page |
getVersion(int versionNumber)
Retrieves a given Page version. |
int |
getVersions()
|
void |
ignoreVersionMerge()
Call this method when the current (ajax) request shouldn't merge the changes that are happening to the page with the previous version. |
Page |
rollbackPage(int numberOfVersions)
This method rollbacks the page the number of versions specified Including the ajax versions. |
| Method Detail |
|---|
void beginVersion(boolean mergeVersion)
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 - The component that was added.void componentModelChanging(Component component)
component - The component whose model is about to changevoid componentStateChanging(Change change)
change - The change which represents the internal statevoid componentRemoved(Component component)
component - The component that was removed.void endVersion(boolean mergeVersion)
mergeVersion - If this is set the version that was created is merged with the previous one.IPageVersionManager#beginVersion()void expireOldestVersion()
Page getVersion(int versionNumber)
versionNumber - The version of the page to get
Page rollbackPage(int numberOfVersions)
numberOfVersions -
int getVersions()
int getCurrentVersionNumber()
int getAjaxVersionNumber()
void ignoreVersionMerge()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||