01: /**********************************************************************************
02: * $URL:https://source.sakaiproject.org/svn/osp/trunk/matrix/tool/src/java/org/theospi/portfolio/matrix/control/EditScaffoldingCellConfirmationController.java $
03: * $Id:EditScaffoldingCellConfirmationController.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006, 2007 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.theospi.portfolio.matrix.control;
21:
22: import java.util.HashMap;
23: import java.util.Map;
24:
25: import org.apache.commons.logging.Log;
26: import org.apache.commons.logging.LogFactory;
27: import org.sakaiproject.metaobj.shared.model.Id;
28: import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
29: import org.sakaiproject.metaobj.utils.mvc.intf.FormController;
30: import org.sakaiproject.metaobj.utils.mvc.intf.LoadObjectController;
31: import org.springframework.validation.Errors;
32: import org.springframework.web.servlet.ModelAndView;
33: import org.theospi.portfolio.matrix.model.ScaffoldingCell;
34:
35: public class EditScaffoldingCellConfirmationController extends
36: BaseScaffoldingCellController implements Controller,
37: FormController, LoadObjectController {
38:
39: protected final Log logger = LogFactory.getLog(getClass());
40:
41: public ModelAndView handleRequest(Object requestModel, Map request,
42: Map session, Map application, Errors errors) {
43: ScaffoldingCell scaffoldingCell = (ScaffoldingCell) requestModel;
44: String viewName = "success";
45: Id id = scaffoldingCell.getId();
46:
47: Map model = new HashMap();
48: model.put("scaffoldingCell_id", id);
49:
50: String cancel = (String) request.get("cancel");
51: String next = (String) request.get("continue");
52: if (cancel != null) {
53: viewName = "cancel";
54: } else if (next != null) {
55: saveScaffoldingCell(request, scaffoldingCell);
56: model.put("scaffolding_id", scaffoldingCell
57: .getScaffolding().getId());
58: if (getTaggingManager().isTaggable()) {
59: session.remove(PROVIDERS_PARAM);
60: }
61: }
62:
63: session
64: .remove(EditedScaffoldingStorage.STORED_SCAFFOLDING_FLAG);
65: session
66: .remove(EditedScaffoldingStorage.EDITED_SCAFFOLDING_STORAGE_SESSION_KEY);
67:
68: return new ModelAndView(viewName, model);
69: }
70:
71: public Map referenceData(Map request, Object command, Errors errors) {
72: Map model = new HashMap();
73: model.put("label", "Scaffolding Cell");
74: return model;
75: }
76: }
|