| 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.form.pojo; | |
| 17 | ||
| 18 | import javax.servlet.http.HttpServletRequest; | |
| 19 | import java.util.Map; | |
| 20 | import java.util.Set; | |
| 21 | ||
| 22 | /** | |
| 23 | * begin Kuali Foundation modification | |
| 24 | * This interface defines methods that Pojo Forms must provide. | |
| 25 | * end Kuali Foundation modification | |
| 26 | */ | |
| 27 | // Kuali Foundation modification: original name: SLForm | |
| 28 | public interface PojoForm { | |
| 29 | public void populate(HttpServletRequest request); | |
| 30 | ||
| 31 | // begin Kuali Foundation modification | |
| 32 | // cachedActionErrors() method removed | |
| 33 | public void postprocessRequestParameters(Map requestParameters); | |
| 34 | // end Kuali Foundation modification | |
| 35 | ||
| 36 | public Map getUnconvertedValues(); | |
| 37 | ||
| 38 | public Object formatValue(Object value, String keypath, Class type); | |
| 39 | ||
| 40 | // begin Kuali Foundation modification | |
| 41 | public void processValidationFail(); | |
| 42 | ||
| 43 | Set<String> getRequiredNonEditableProperties(); | |
| 44 | ||
| 45 | void registerEditableProperty(String editablePropertyName); | |
| 46 | ||
| 47 | /** | |
| 48 | * Reinitializes the form to allow it to register the editable properties of the currently processing request. | |
| 49 | */ | |
| 50 | void clearEditablePropertyInformation(); | |
| 51 | ||
| 52 | Set<String> getEditableProperties(); | |
| 53 | ||
| 54 | /** | |
| 55 | * | |
| 56 | * 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 | |
| 57 | * in which they appear. Request parameter names corresponding to these properties | |
| 58 | * will be populated into the form. | |
| 59 | * | |
| 60 | */ | |
| 61 | void addRequiredNonEditableProperties(); | |
| 62 | ||
| 63 | /** | |
| 64 | * Sets the value of the "scope" attribute for the Struts action mapping corresponding to this form instance. Note that this | |
| 65 | * method name is NOT in the syntax of the conventional POJO setter; this is to prevent clients from maliciously altering the value | |
| 66 | * of this parameter | |
| 67 | * | |
| 68 | * @param scope | |
| 69 | */ | |
| 70 | public void registerStrutsActionMappingScope(String scope); | |
| 71 | ||
| 72 | ||
| 73 | public void registerIsNewForm(boolean isNewForm); | |
| 74 | ||
| 75 | public boolean getIsNewForm(); | |
| 76 | ||
| 77 | ||
| 78 | /** | |
| 79 | * Returns whether a request parameter should be populated as a property of the form, assuming that the request parameter name | |
| 80 | * corresponds to a property on the form. This method makes no determination whether the request parameter is a property of the form, but rather | |
| 81 | * from a security perspective, whether the framework should attempt to set the form property with the same name as the request parameter. | |
| 82 | * | |
| 83 | * @param requestParameterName the name of the request parameter | |
| 84 | * @param request the HTTP request | |
| 85 | * @return whether the parameter should be | |
| 86 | */ | |
| 87 | public boolean shouldPropertyBePopulatedInForm(String requestParameterName, HttpServletRequest request); | |
| 88 | ||
| 89 | /** | |
| 90 | * Returns a set of methodToCalls for which the system will bypass the session. The return value of this method may depend ONLY upon the | |
| 91 | * type of the class implementing it. Each instance of an implementation of this interface | |
| 92 | * must return the same result. More formally, for 2 instances of this interfaces a1 and a2, if a1.getClass().equals(a2.getClass()), then | |
| 93 | * a1.getMethodToCallsToBypassSessionRetrievalForGETRequests().equals(a2.getMethodToCallsToBypassSessionRetrievalForGETRequests()) | |
| 94 | * | |
| 95 | * NOTE: read Javadoc of {@link PojoFormBase#getMethodToCallsToBypassSessionRetrievalForGETRequests()} for important implementation details. | |
| 96 | * | |
| 97 | * @return | |
| 98 | */ | |
| 99 | public Set<String> getMethodToCallsToBypassSessionRetrievalForGETRequests(); | |
| 100 | ||
| 101 | /** | |
| 102 | * Sets the editable properties guid for this form | |
| 103 | * @param guid the key to the editable properties for this form | |
| 104 | */ | |
| 105 | public abstract void setPopulateEditablePropertiesGuid(String guid); | |
| 106 | ||
| 107 | /** | |
| 108 | * Sets the guid associated with the edited properties associated with the action | |
| 109 | * | |
| 110 | * @param guid the guid of the action editable properties | |
| 111 | */ | |
| 112 | public abstract void setActionEditablePropertiesGuid(String guid); | |
| 113 | // end Kuali Foundation modification | |
| 114 | ||
| 115 | } |