01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/CourseBean.java $
03: * $Id: CourseBean.java 18134 2006-11-14 18:59:25Z jholtzman@berkeley.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Regents of the University of California and The Regents of the University of Michigan
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;
21:
22: import java.io.Serializable;
23:
24: import org.sakaiproject.section.api.SectionManager;
25: import org.sakaiproject.section.api.coursemanagement.Course;
26: import org.sakaiproject.section.api.facade.manager.Authn;
27: import org.sakaiproject.section.api.facade.manager.Authz;
28: import org.sakaiproject.section.api.facade.manager.Context;
29:
30: /**
31: * Provides the current course uuid for a given user session. This is also the
32: * integration point for JSF backing beans and Spring-manages services.
33: *
34: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
35: *
36: */
37: public class CourseBean implements Serializable {
38:
39: private static final long serialVersionUID = 1L;
40:
41: private String courseUuid;
42:
43: protected SectionManager sectionManager;
44: protected Authn authn;
45: protected Authz authz;
46: protected Context context;
47: protected PreferencesBean prefs;
48:
49: protected String getCourseUuid() {
50: Course course = sectionManager.getCourse(context
51: .getContext(null));
52: courseUuid = course.getUuid();
53: return courseUuid;
54: }
55:
56: public SectionManager getSectionManager() {
57: return sectionManager;
58: }
59:
60: //// Setters for dep. injection
61: public void setSectionManager(SectionManager sectionManager) {
62: this .sectionManager = sectionManager;
63: }
64:
65: public void setAuthn(Authn authn) {
66: this .authn = authn;
67: }
68:
69: public void setAuthz(Authz authz) {
70: this .authz = authz;
71: }
72:
73: public void setContext(Context context) {
74: this .context = context;
75: }
76:
77: public PreferencesBean getPrefs() {
78: return prefs;
79: }
80:
81: public void setPrefs(PreferencesBean prefs) {
82: this.prefs = prefs;
83: }
84:
85: }
|