01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/presentation/tool/src/java/org/theospi/portfolio/presentation/control/HidePresentationController.java $
03: * $Id: HidePresentationController.java 21614 2007-02-15 17:16:23Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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: **********************************************************************************/
21:
22: /**
23: *
24: */package org.theospi.portfolio.presentation.control;
25:
26: import java.util.Map;
27:
28: import org.sakaiproject.metaobj.shared.model.Agent;
29: import org.springframework.validation.Errors;
30: import org.springframework.web.servlet.ModelAndView;
31: import org.theospi.portfolio.presentation.PresentationFunctionConstants;
32:
33: /**
34: * @author chrismaurer
35: *
36: */
37: public class HidePresentationController extends
38: ListPresentationController {
39:
40: /* (non-Javadoc)
41: * @see org.sakaiproject.metaobj.utils.mvc.intf.Controller#handleRequest(java.lang.Object, java.util.Map, java.util.Map, java.util.Map, org.springframework.validation.Errors)
42: */
43: public ModelAndView handleRequest(Object requestModel, Map request,
44: Map session, Map application, Errors errors) {
45: Agent current = getAuthManager().getAgent();
46: String hideAction = (String) request.get("hideAction");
47: String id = (String) request.get("id");
48:
49: if ("hide".equals(hideAction)) {
50: getAuthzManager().createAuthorization(current,
51: PresentationFunctionConstants.HIDE_PRESENTATION,
52: getIdManager().getId(id));
53: } else {
54: getAuthzManager().deleteAuthorization(current,
55: PresentationFunctionConstants.HIDE_PRESENTATION,
56: getIdManager().getId(id));
57: }
58:
59: return super.handleRequest(requestModel, request, session,
60: application, errors);
61: }
62:
63: }
|