01: /**********************************************************************************
02: *
03: * $Id: GradebookConfiguration.java 20345 2007-01-16 20:25:32Z ray@media.berkeley.edu $
04: *
05: ***********************************************************************************
06: *
07: * Copyright (c) 2006 The Regents of the University of California, The MIT Corporation
08: *
09: * Licensed under the Educational Community License, Version 1.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.opensource.org/licenses/ecl1.php
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: *
21: **********************************************************************************/package org.sakaiproject.service.gradebook.shared;
22:
23: import java.util.Collection;
24:
25: /**
26: * Simple configuration bean. Set up the properties you want changed and
27: * call init() when the GradebookService is wired up. (We can't set them
28: * directly by injecting the GradebookService bean because that would
29: * bypass transaction proxying.)
30: */
31: public class GradebookConfiguration {
32: private Collection gradingScaleDefinitions;
33: private String defaultGradingScale;
34: private GradebookFrameworkService gradebookFrameworkService;
35:
36: public void init() {
37: if (gradebookFrameworkService != null) {
38: if (gradingScaleDefinitions != null) {
39: gradebookFrameworkService
40: .setAvailableGradingScales(gradingScaleDefinitions);
41: }
42: if (defaultGradingScale != null) {
43: gradebookFrameworkService
44: .setDefaultGradingScale(defaultGradingScale);
45: }
46: }
47: }
48:
49: public void setAvailableGradingScales(
50: Collection gradingScaleDefinitions) {
51: this .gradingScaleDefinitions = gradingScaleDefinitions;
52: }
53:
54: public void setDefaultGradingScale(String defaultGradingScale) {
55: this .defaultGradingScale = defaultGradingScale;
56: }
57:
58: public void setGradebookFrameworkService(
59: GradebookFrameworkService gradebookFrameworkService) {
60: this.gradebookFrameworkService = gradebookFrameworkService;
61: }
62: }
|