001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/NavMenuBean.java $
003: * $Id: NavMenuBean.java 19440 2006-12-12 21:54:31Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Regents of the University of California and The Regents of the University of Michigan
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.section.jsf.backingbean;
021:
022: import org.apache.commons.logging.Log;
023: import org.apache.commons.logging.LogFactory;
024: import org.sakaiproject.section.api.SectionManager;
025: import org.sakaiproject.section.api.SectionManager.ExternalIntegrationConfig;
026:
027: /**
028: * Caches whether the instructor features are enabled for the current user in
029: * the current request.
030: *
031: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
032: *
033: */
034: public class NavMenuBean extends CourseDependentBean {
035: private static final Log log = LogFactory.getLog(NavMenuBean.class);
036: private static final long serialVersionUID = 1L;
037:
038: private boolean sectionTaManagementEnabled;
039: private boolean sectionEnrollmentMangementEnabled;
040: private boolean sectionOptionsManagementEnabled;
041: private boolean sectionManagementEnabled;
042:
043: public NavMenuBean() {
044: String courseUuid = super .getCourse().getUuid();
045: ExternalIntegrationConfig appConfig = super
046: .getApplicationConfiguration();
047:
048: this .sectionManagementEnabled = super
049: .isSectionManagementEnabled()
050: && !super .getSectionManager().isExternallyManaged(
051: courseUuid);
052:
053: this .sectionOptionsManagementEnabled = super
054: .isSectionOptionsManagementEnabled()
055: && appConfig != SectionManager.ExternalIntegrationConfig.AUTOMATIC_MANDATORY;
056:
057: this .sectionEnrollmentMangementEnabled = super
058: .isSectionEnrollmentMangementEnabled()
059: && !super .getSectionManager().isExternallyManaged(
060: courseUuid);
061:
062: this .sectionTaManagementEnabled = super
063: .isSectionTaManagementEnabled();
064: }
065:
066: public boolean isSectionEnrollmentMangementEnabled() {
067: return sectionEnrollmentMangementEnabled;
068: }
069:
070: public void setSectionEnrollmentMangementEnabled(
071: boolean sectionEnrollmentMangementEnabled) {
072: this .sectionEnrollmentMangementEnabled = sectionEnrollmentMangementEnabled;
073: }
074:
075: public boolean isSectionManagementEnabled() {
076: return sectionManagementEnabled;
077: }
078:
079: public void setSectionManagementEnabled(
080: boolean sectionManagementEnabled) {
081: this .sectionManagementEnabled = sectionManagementEnabled;
082: }
083:
084: public boolean isSectionOptionsManagementEnabled() {
085: return sectionOptionsManagementEnabled;
086: }
087:
088: public void setSectionOptionsManagementEnabled(
089: boolean sectionOptionsManagementEnabled) {
090: this .sectionOptionsManagementEnabled = sectionOptionsManagementEnabled;
091: }
092:
093: public boolean isSectionTaManagementEnabled() {
094: return sectionTaManagementEnabled;
095: }
096:
097: public void setSectionTaManagementEnabled(
098: boolean sectionTaManagementEnabled) {
099: this.sectionTaManagementEnabled = sectionTaManagementEnabled;
100: }
101:
102: }
|