01: /**********************************************************************************
02: * $URL:https://source.sakaiproject.org/svn/osp/trunk/matrix/tool/src/java/org/theospi/portfolio/matrix/control/MatrixResetController.java $
03: * $Id:MatrixResetController.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.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.Map;
23:
24: import org.sakaiproject.metaobj.shared.mgt.IdManager;
25: import org.sakaiproject.metaobj.shared.model.Id;
26: import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
27: import org.springframework.validation.Errors;
28: import org.springframework.web.servlet.ModelAndView;
29: import org.theospi.portfolio.matrix.MatrixManager;
30:
31: /**
32: * @author apple
33: */
34: public class MatrixResetController implements Controller {
35:
36: IdManager idManager;
37: MatrixManager matrixManager;
38:
39: /* (non-Javadoc)
40: * @see org.theospi.utils.mvc.intf.Controller#handleRequest(java.lang.Object, java.util.Map, java.util.Map, java.util.Map, org.springframework.validation.Errors)
41: */
42: public ModelAndView handleRequest(Object requestModel, Map request,
43: Map session, Map application, Errors errors) {
44:
45: Id matrixId = getIdManager().getId(
46: (String) request.get("matrix_id"));
47:
48: getMatrixManager().deleteMatrix(matrixId);
49: return new ModelAndView("success");
50: }
51:
52: /**
53: * @return Returns the matrixManager.
54: */
55: public MatrixManager getMatrixManager() {
56: return matrixManager;
57: }
58:
59: /**
60: * @param matrixManager The matrixManager to set.
61: */
62: public void setMatrixManager(MatrixManager matrixManager) {
63: this .matrixManager = matrixManager;
64: }
65:
66: /**
67: * @return Returns the idManager.
68: */
69: public IdManager getIdManager() {
70: return idManager;
71: }
72:
73: /**
74: * @param idManager The idManager to set.
75: */
76: public void setIdManager(IdManager idManager) {
77: this.idManager = idManager;
78: }
79: }
|