|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
PropertyPersistenceStrategy.java | - | - | - | - |
|
1 | // Copyright 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.tapestry.record; | |
16 | ||
17 | import java.util.Collection; | |
18 | ||
19 | import org.apache.tapestry.engine.ServiceEncoding; | |
20 | ||
21 | /** | |
22 | * Defines how a persistent property is made persistent. The typical implementation is to store the | |
23 | * persistent property into the session as a session attribute. | |
24 | * | |
25 | * @author Howard M. Lewis Ship | |
26 | * @since 4.0 | |
27 | */ | |
28 | public interface PropertyPersistenceStrategy | |
29 | { | |
30 | /** | |
31 | * Stores the new value. | |
32 | * | |
33 | * @param pageName | |
34 | * the name of the page containing the property | |
35 | * @param idPath | |
36 | * the path to the component with the property (may be null) | |
37 | * @param propertyName | |
38 | * the name of the property to be persisted | |
39 | * @param newValue | |
40 | * the new value (which may be null) | |
41 | */ | |
42 | ||
43 | public void store(String pageName, String idPath, String propertyName, Object newValue); | |
44 | ||
45 | /** | |
46 | * Returns a collection of {@link org.apache.tapestry.record.PropertyChange}s. These represent | |
47 | * prior changes previously stored. The order is not significant. Must not return null. Does not | |
48 | * have to reflect changes made during the current request (this method is typically invoked as | |
49 | * part of rolling back a page to a prior state, before any further changes are possible). | |
50 | */ | |
51 | ||
52 | public Collection getStoredChanges(String pageName); | |
53 | ||
54 | /** | |
55 | * Invoked to discard any stored changes for the specified page. | |
56 | */ | |
57 | public void discardStoredChanges(String pageName); | |
58 | ||
59 | /** | |
60 | * Invoked by a {@link org.apache.tapestry.services.LinkFactory} , the parameters may be | |
61 | * modified (added to) to store information related to persistent properties. This method is | |
62 | * forwarded to all {@link PropertyPersistenceStrategy}s. | |
63 | * | |
64 | * @param encoding | |
65 | * Service encoding, which indentifies the URL and the query parameters from which | |
66 | * the {@link org.apache.tapestry.engine.ILink} will be created. | |
67 | * @param post | |
68 | * if true, then the link will be used for a post (not a get, i.e., for a HTML form); | |
69 | * this may affect what information is encoded into the link | |
70 | * @see PropertyPersistenceStrategySource | |
71 | */ | |
72 | ||
73 | public void addParametersForPersistentProperties(ServiceEncoding encoding, boolean post); | |
74 | } |
|