org.apache.tapestry.record
Interface PropertyPersistenceStrategy

All Known Implementing Classes:
ClientPropertyPersistenceStrategy, SessionPropertyPersistenceStrategy

public interface PropertyPersistenceStrategy

Defines how a persistent property is made persistent. The typical implementation is to store the persistent property into the session as a session attribute.

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
 void addParametersForPersistentProperties(ServiceEncoding encoding, boolean post)
          Invoked by a LinkFactory , the parameters may be modified (added to) to store information related to persistent properties.
 void discardStoredChanges(java.lang.String pageName)
          Invoked to discard any stored changes for the specified page.
 java.util.Collection getStoredChanges(java.lang.String pageName)
          Returns a collection of PropertyChanges.
 void store(java.lang.String pageName, java.lang.String idPath, java.lang.String propertyName, java.lang.Object newValue)
          Stores the new value.
 

Method Detail

store

void store(java.lang.String pageName,
           java.lang.String idPath,
           java.lang.String propertyName,
           java.lang.Object newValue)
Stores the new value.

Parameters:
pageName - the name of the page containing the property
idPath - the path to the component with the property (may be null)
propertyName - the name of the property to be persisted
newValue - the new value (which may be null)

getStoredChanges

java.util.Collection getStoredChanges(java.lang.String pageName)
Returns a collection of PropertyChanges. These represent prior changes previously stored. The order is not significant. Must not return null. Does not have to reflect changes made during the current request (this method is typically invoked as part of rolling back a page to a prior state, before any further changes are possible).


discardStoredChanges

void discardStoredChanges(java.lang.String pageName)
Invoked to discard any stored changes for the specified page.


addParametersForPersistentProperties

void addParametersForPersistentProperties(ServiceEncoding encoding,
                                          boolean post)
Invoked by a LinkFactory , the parameters may be modified (added to) to store information related to persistent properties. This method is forwarded to all PropertyPersistenceStrategys.

Parameters:
encoding - Service encoding, which indentifies the URL and the query parameters from which the ILink will be created.
post - if true, then the link will be used for a post (not a get, i.e., for a HTML form); this may affect what information is encoded into the link
See Also:
PropertyPersistenceStrategySource