01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/trunk/matrix/tool/src/java/org/theospi/portfolio/matrix/control/PublishScaffoldingConfirmationController.java $
03: * $Id: PublishScaffoldingConfirmationController.java 10835 2006-06-17 03:25:03Z lance@indiana.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.theospi.portfolio.matrix.control;
21:
22: import java.util.HashMap;
23: import java.util.Map;
24:
25: import org.sakaiproject.metaobj.shared.mgt.IdManager;
26: import org.sakaiproject.metaobj.shared.model.Id;
27: import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
28: import org.springframework.validation.Errors;
29: import org.springframework.web.servlet.ModelAndView;
30: import org.theospi.portfolio.matrix.MatrixManager;
31:
32: /**
33: * @author chmaurer
34: */
35: public class PreviewScaffoldingController implements Controller {
36:
37: MatrixManager matrixManager = null;
38: IdManager idManager = null;
39:
40: /* (non-Javadoc)
41: * @see org.theospi.utils.mvc.intf.Controller#handleRequest(java.lang.Object, java.util.Map, java.util.Map, java.util.Map, org.springframework.validation.Errors)
42: */
43:
44: public ModelAndView handleRequest(Object requestModel, Map request,
45: Map session, Map application, Errors errors) {
46: String viewName = "success";
47: Id id = idManager.getId((String) request.get("scaffolding_id"));
48:
49: Map model = new HashMap();
50: model.put("scaffolding_id", id);
51:
52: matrixManager.previewScaffolding(id);
53:
54: return new ModelAndView("success", model);
55: }
56:
57: public IdManager getIdManager() {
58: return idManager;
59: }
60:
61: public void setIdManager(IdManager idManager) {
62: this .idManager = idManager;
63: }
64:
65: public MatrixManager getMatrixManager() {
66: return matrixManager;
67: }
68:
69: public void setMatrixManager(MatrixManager matrixManager) {
70: this.matrixManager = matrixManager;
71: }
72: }
|