001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kns.web.struts.form.pojo; 017 018import javax.servlet.http.HttpServletRequest; 019import java.util.Map; 020import java.util.Set; 021 022/** 023 * begin Kuali Foundation modification 024 * This interface defines methods that Pojo Forms must provide. 025 * 026 * @deprecated KNS Struts deprecated, use KRAD and the Spring MVC framework. 027 * end Kuali Foundation modification 028 */ 029// Kuali Foundation modification: original name: SLForm 030@Deprecated 031public interface PojoForm { 032 public void populate(HttpServletRequest request); 033 034 // begin Kuali Foundation modification 035 // cachedActionErrors() method removed 036 public void postprocessRequestParameters(Map requestParameters); 037 // end Kuali Foundation modification 038 039 public Map getUnconvertedValues(); 040 041 public Object formatValue(Object value, String keypath, Class type); 042 043 // begin Kuali Foundation modification 044 public void processValidationFail(); 045 046 Set<String> getRequiredNonEditableProperties(); 047 048 void registerEditableProperty(String editablePropertyName); 049 050 /** 051 * Reinitializes the form to allow it to register the editable properties of the currently processing request. 052 */ 053 void clearEditablePropertyInformation(); 054 055 Set<String> getEditableProperties(); 056 057 /** 058 * 059 * 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 060 * in which they appear. Request parameter names corresponding to these properties 061 * will be populated into the form. 062 * 063 */ 064 void addRequiredNonEditableProperties(); 065 066 /** 067 * Sets the value of the "scope" attribute for the Struts action mapping corresponding to this form instance. Note that this 068 * method name is NOT in the syntax of the conventional POJO setter; this is to prevent clients from maliciously altering the value 069 * of this parameter 070 * 071 * @param scope 072 */ 073 public void registerStrutsActionMappingScope(String scope); 074 075 076 public void registerIsNewForm(boolean isNewForm); 077 078 public boolean getIsNewForm(); 079 080 081 /** 082 * Returns whether a request parameter should be populated as a property of the form, assuming that the request parameter name 083 * corresponds to a property on the form. This method makes no determination whether the request parameter is a property of the form, but rather 084 * from a security perspective, whether the framework should attempt to set the form property with the same name as the request parameter. 085 * 086 * @param requestParameterName the name of the request parameter 087 * @param request the HTTP request 088 * @return whether the parameter should be 089 */ 090 public boolean shouldPropertyBePopulatedInForm(String requestParameterName, HttpServletRequest request); 091 092 /** 093 * Returns a set of methodToCalls for which the system will bypass the session. The return value of this method may depend ONLY upon the 094 * type of the class implementing it. Each instance of an implementation of this interface 095 * must return the same result. More formally, for 2 instances of this interfaces a1 and a2, if a1.getClass().equals(a2.getClass()), then 096 * a1.getMethodToCallsToBypassSessionRetrievalForGETRequests().equals(a2.getMethodToCallsToBypassSessionRetrievalForGETRequests()) 097 * 098 * NOTE: read Javadoc of {@link PojoFormBase#getMethodToCallsToBypassSessionRetrievalForGETRequests()} for important implementation details. 099 * 100 * @return 101 */ 102 public Set<String> getMethodToCallsToBypassSessionRetrievalForGETRequests(); 103 104 /** 105 * Sets the editable properties guid for this form 106 * @param guid the key to the editable properties for this form 107 */ 108 public abstract void setPopulateEditablePropertiesGuid(String guid); 109 110 /** 111 * Sets the guid associated with the edited properties associated with the action 112 * 113 * @param guid the guid of the action editable properties 114 */ 115 public abstract void setActionEditablePropertiesGuid(String guid); 116 // end Kuali Foundation modification 117 118}