01: /*******************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/shared/control/FormHelperController.java $
03: * $Id: FormHelperController.java 21054 2007-02-06 18:09:53Z john.ellis@rsmart.com $
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.shared.control;
21:
22: import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
23: import org.sakaiproject.content.api.ResourceEditingHelper;
24: import org.springframework.web.servlet.ModelAndView;
25: import org.springframework.validation.Errors;
26:
27: import java.util.Map;
28:
29: /**
30: * Created by IntelliJ IDEA.
31: * User: John Ellis
32: * Date: Feb 7, 2006
33: * Time: 11:34:11 AM
34: * To change this template use File | Settings | File Templates.
35: */
36: public class FormHelperController implements Controller {
37:
38: public ModelAndView handleRequest(Object requestModel, Map request,
39: Map session, Map application, Errors errors) {
40: if (session.get(ResourceEditingHelper.ATTACHMENT_ID) != null) {
41: return new ModelAndView("edit");
42: } else {
43: return new ModelAndView("create");
44: }
45: }
46:
47: }
|