Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PojoForm |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2004 Jonathan M. Lehr | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" | |
11 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language | |
12 | * governing permissions and limitations under the License. | |
13 | * | |
14 | * MODIFIED BY THE KUALI FOUNDATION | |
15 | */ | |
16 | package org.kuali.rice.kns.web.struts.pojo; | |
17 | ||
18 | import java.util.Map; | |
19 | import java.util.Set; | |
20 | ||
21 | import javax.servlet.http.HttpServletRequest; | |
22 | ||
23 | /** | |
24 | * begin Kuali Foundation modification | |
25 | * This interface defines methods that Pojo Forms must provide. | |
26 | * end Kuali Foundation modification | |
27 | */ | |
28 | // Kuali Foundation modification: original name: SLForm | |
29 | public interface PojoForm { | |
30 | public void populate(HttpServletRequest request); | |
31 | ||
32 | // begin Kuali Foundation modification | |
33 | // cachedActionErrors() method removed | |
34 | public void postprocessRequestParameters(Map requestParameters); | |
35 | // end Kuali Foundation modification | |
36 | ||
37 | public Map getUnconvertedValues(); | |
38 | ||
39 | public Object formatValue(Object value, String keypath, Class type); | |
40 | ||
41 | // begin Kuali Foundation modification | |
42 | public void processValidationFail(); | |
43 | ||
44 | Set<String> getRequiredNonEditableProperties(); | |
45 | ||
46 | void registerEditableProperty(String editablePropertyName); | |
47 | ||
48 | /** | |
49 | * Reinitializes the form to allow it to register the editable properties of the currently processing request. | |
50 | */ | |
51 | void clearEditablePropertyInformation(); | |
52 | ||
53 | Set<String> getEditableProperties(); | |
54 | ||
55 | /** | |
56 | * | |
57 | * This method adds the required property names, that are not directly editable by user on the html page, to a list, regardless of the context | |
58 | * in which they appear. Request parameter names corresponding to these properties | |
59 | * will be populated into the form. | |
60 | * | |
61 | */ | |
62 | void addRequiredNonEditableProperties(); | |
63 | ||
64 | /** | |
65 | * Sets the value of the "scope" attribute for the Struts action mapping corresponding to this form instance. Note that this | |
66 | * method name is NOT in the syntax of the conventional POJO setter; this is to prevent clients from maliciously altering the value | |
67 | * of this parameter | |
68 | * | |
69 | * @param scope | |
70 | */ | |
71 | public void registerStrutsActionMappingScope(String scope); | |
72 | ||
73 | ||
74 | public void registerIsNewForm(boolean isNewForm); | |
75 | ||
76 | public boolean getIsNewForm(); | |
77 | ||
78 | ||
79 | /** | |
80 | * Returns whether a request parameter should be populated as a property of the form, assuming that the request parameter name | |
81 | * corresponds to a property on the form. This method makes no determination whether the request parameter is a property of the form, but rather | |
82 | * from a security perspective, whether the framework should attempt to set the form property with the same name as the request parameter. | |
83 | * | |
84 | * @param requestParameterName the name of the request parameter | |
85 | * @param request the HTTP request | |
86 | * @return whether the parameter should be | |
87 | */ | |
88 | public boolean shouldPropertyBePopulatedInForm(String requestParameterName, HttpServletRequest request); | |
89 | ||
90 | /** | |
91 | * Returns a set of methodToCalls for which the system will bypass the session. The return value of this method may depend ONLY upon the | |
92 | * type of the class implementing it. Each instance of an implementation of this interface | |
93 | * must return the same result. More formally, for 2 instances of this interfaces a1 and a2, if a1.getClass().equals(a2.getClass()), then | |
94 | * a1.getMethodToCallsToBypassSessionRetrievalForGETRequests().equals(a2.getMethodToCallsToBypassSessionRetrievalForGETRequests()) | |
95 | * | |
96 | * NOTE: read Javadoc of {@link PojoFormBase#getMethodToCallsToBypassSessionRetrievalForGETRequests()} for important implementation details. | |
97 | * | |
98 | * @return | |
99 | */ | |
100 | public Set<String> getMethodToCallsToBypassSessionRetrievalForGETRequests(); | |
101 | ||
102 | /** | |
103 | * Sets the editable properties guid for this form | |
104 | * @param guid the key to the editable properties for this form | |
105 | */ | |
106 | public abstract void setPopulateEditablePropertiesGuid(String guid); | |
107 | ||
108 | /** | |
109 | * Sets the guid associated with the edited properties associated with the action | |
110 | * | |
111 | * @param guid the guid of the action editable properties | |
112 | */ | |
113 | public abstract void setActionEditablePropertiesGuid(String guid); | |
114 | // end Kuali Foundation modification | |
115 | ||
116 | } |