01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/ConfigBean.java $
03: * $Id: ConfigBean.java 18493 2006-11-28 17:27:43Z jholtzman@berkeley.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.tool.section.jsf.backingbean.standalone;
21:
22: import javax.faces.context.FacesContext;
23: import javax.servlet.ServletContext;
24:
25: import org.sakaiproject.section.api.SectionManager;
26: import org.sakaiproject.tool.section.jsf.backingbean.CourseDependentBean;
27:
28: public class ConfigBean extends CourseDependentBean {
29: private static final long serialVersionUID = 1L;
30:
31: public String updateConfigAllManual() {
32: getServletContext()
33: .setAttribute(
34: SectionManager.CONFIGURATION_KEY,
35: SectionManager.ExternalIntegrationConfig.MANUAL_MANDATORY);
36: return "overview";
37: }
38:
39: public String updateConfigAllAutomatic() {
40: getServletContext()
41: .setAttribute(
42: SectionManager.CONFIGURATION_KEY,
43: SectionManager.ExternalIntegrationConfig.AUTOMATIC_MANDATORY);
44: return "overview";
45: }
46:
47: public String updateConfigOptionalAll() {
48: getServletContext()
49: .setAttribute(
50: SectionManager.CONFIGURATION_KEY,
51: SectionManager.ExternalIntegrationConfig.AUTOMATIC_DEFAULT);
52: return "overview";
53: }
54:
55: public String updateConfigOptionalMultiple() {
56: getServletContext()
57: .setAttribute(
58: SectionManager.CONFIGURATION_KEY,
59: SectionManager.ExternalIntegrationConfig.MANUAL_DEFAULT);
60: return "overview";
61: }
62:
63: private ServletContext getServletContext() {
64: return (ServletContext) FacesContext.getCurrentInstance()
65: .getExternalContext().getContext();
66: }
67: }
|