001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/PreferencesBean.java $
003: * $Id: PreferencesBean.java 21060 2007-02-06 20:48:59Z ray@media.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.sakaiproject.tool.section.jsf.JsfUtil;
023:
024: /**
025: * Stores user preferences for table sorting and paging. These preferences are
026: * currently implemented in session-scope, though this could be reimplemented
027: * to store preferences across sessions.
028: *
029: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
030: *
031: */
032: public class PreferencesBean extends CourseDependentBean {
033:
034: private static final long serialVersionUID = 1L;
035:
036: public PreferencesBean() {
037: overviewSortColumn = "title";
038: overviewSortAscending = true;
039:
040: rosterSortColumn = "studentName";
041: rosterSortAscending = true;
042: rosterMaxDisplayedRows = 50;
043: }
044:
045: public void init() {
046: // Get the max name length for displaying names from the app's properties file.
047: // We can't do this in the constructor, since we need to wait for our dependencies.
048: maxNameLength = Integer.parseInt(JsfUtil
049: .getLocalizedMessage("max_name_length"));
050: }
051:
052: protected int maxNameLength;
053: protected String overviewSortColumn;
054: protected boolean overviewSortAscending;
055: protected String overviewMyFilter;
056: protected String overviewCategoryFilter;
057:
058: protected String rosterSortColumn;
059: protected boolean rosterSortAscending;
060: protected int rosterMaxDisplayedRows;
061: protected String rosterFilter;
062:
063: protected String editStudentSectionsSortColumn;
064: protected boolean editStudentSectionsSortAscending;
065: protected String editStudentSectionsMyFilter;
066: protected String editStudentSectionsCategoryFilter;
067:
068: public boolean isOverviewSortAscending() {
069: return overviewSortAscending;
070: }
071:
072: public void setOverviewSortAscending(boolean overviewSortAscending) {
073: this .overviewSortAscending = overviewSortAscending;
074: }
075:
076: public String getOverviewSortColumn() {
077: return overviewSortColumn;
078: }
079:
080: public void setOverviewSortColumn(String overviewSortColumn) {
081: this .overviewSortColumn = overviewSortColumn;
082: }
083:
084: public int getRosterMaxDisplayedRows() {
085: return rosterMaxDisplayedRows;
086: }
087:
088: public void setRosterMaxDisplayedRows(int rosterMaxDisplayedRows) {
089: this .rosterMaxDisplayedRows = rosterMaxDisplayedRows;
090: }
091:
092: public boolean isRosterSortAscending() {
093: return rosterSortAscending;
094: }
095:
096: public void setRosterSortAscending(boolean rosterSortAscending) {
097: this .rosterSortAscending = rosterSortAscending;
098: }
099:
100: public String getRosterSortColumn() {
101: return rosterSortColumn;
102: }
103:
104: public void setRosterSortColumn(String rosterSortColumn) {
105: this .rosterSortColumn = rosterSortColumn;
106: }
107:
108: public int getMaxNameLength() {
109: return maxNameLength;
110: }
111:
112: public boolean isEditStudentSectionsSortAscending() {
113: return editStudentSectionsSortAscending;
114: }
115:
116: public void setEditStudentSectionsSortAscending(
117: boolean editStudentSectionsSortAscending) {
118: this .editStudentSectionsSortAscending = editStudentSectionsSortAscending;
119: }
120:
121: public String getEditStudentSectionsSortColumn() {
122: return editStudentSectionsSortColumn;
123: }
124:
125: public void setEditStudentSectionsSortColumn(
126: String editStudentSectionsSortColumn) {
127: this .editStudentSectionsSortColumn = editStudentSectionsSortColumn;
128: }
129:
130: public String getEditStudentSectionsCategoryFilter() {
131: return editStudentSectionsCategoryFilter;
132: }
133:
134: public void setEditStudentSectionsCategoryFilter(
135: String editStudentSectionsCategoryFilter) {
136: this .editStudentSectionsCategoryFilter = editStudentSectionsCategoryFilter;
137: }
138:
139: public String getEditStudentSectionsMyFilter() {
140: return editStudentSectionsMyFilter;
141: }
142:
143: public void setEditStudentSectionsMyFilter(
144: String editStudentSectionsMyFilter) {
145: this .editStudentSectionsMyFilter = editStudentSectionsMyFilter;
146: }
147:
148: public String getOverviewCategoryFilter() {
149: return overviewCategoryFilter;
150: }
151:
152: public void setOverviewCategoryFilter(String overviewCategoryFilter) {
153: this .overviewCategoryFilter = overviewCategoryFilter;
154: }
155:
156: public String getOverviewMyFilter() {
157: return overviewMyFilter;
158: }
159:
160: public void setOverviewMyFilter(String overviewMyFilter) {
161: this .overviewMyFilter = overviewMyFilter;
162: }
163:
164: public void setRosterFilter(String rosterFilter) {
165: this .rosterFilter = rosterFilter;
166: }
167:
168: public String getRosterFilter() {
169: return rosterFilter;
170: }
171: }
|