01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/intf/FormController.java $
03: * $Id: FormController.java 14230 2006-09-05 18:02:51Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.metaobj.utils.mvc.intf;
21:
22: import java.util.Map;
23:
24: import org.springframework.validation.Errors;
25:
26: /*
27: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/utils/mvc/intf/FormController.java $
28: * $Revision: 14230 $
29: * $Date: 2006-09-05 14:02:51 -0400 (Tue, 05 Sep 2006) $
30: */
31:
32: /**
33: * This controller is useful for handling form submissions. In a normal form submission
34: * formBackingObject is called to create the backing object. Next the system binds
35: * request params into this object, and performs validation. If validation errors are
36: * detected the system re-renders the form view. This flow creates a problem if you need
37: * to populate the model with something for the form, because if you try to do this
38: * work in formBackingObject, you notice the system doesn't call this again in the case
39: * of validation erros. The referenceData methods provides an convenient place to do this
40: * work. This method will be called before rendering the form the first time, and before
41: * rendering the form after validation errors.
42: *
43: * @author John Ellis (john.ellis@rsmart.com)
44: * @author John Bush (john.bush@rsmart.com)
45: */
46: public interface FormController extends Controller {
47: /**
48: * Create a map of all data the form requries.
49: * Useful for building up drop down lists, etc.
50: *
51: * @param request
52: * @param command
53: * @param errors
54: * @return
55: */
56: public Map referenceData(Map request, Object command, Errors errors);
57: }
|