Source Code Cross Referenced for OverviewBean.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » tool » section » jsf » backingbean » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.sakaiproject.tool.section.jsf.backingbean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/OverviewBean.java $
003:         * $Id: OverviewBean.java 20230 2007-01-10 01:13:02Z 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 java.io.Serializable;
023:        import java.util.ArrayList;
024:        import java.util.Comparator;
025:        import java.util.HashSet;
026:        import java.util.Iterator;
027:        import java.util.List;
028:        import java.util.Set;
029:
030:        import org.apache.commons.logging.Log;
031:        import org.apache.commons.logging.LogFactory;
032:        import org.sakaiproject.section.api.SectionManager.ExternalIntegrationConfig;
033:        import org.sakaiproject.tool.section.decorator.SectionDecorator;
034:        import org.sakaiproject.tool.section.jsf.JsfUtil;
035:
036:        /**
037:         * Controls the overview page.
038:         *
039:         * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
040:         *
041:         */
042:        public class OverviewBean extends FilteredSectionListingBean implements 
043:                Serializable {
044:
045:            private static final long serialVersionUID = 1L;
046:            private static final Log log = LogFactory
047:                    .getLog(OverviewBean.class);
048:
049:            private String instructions;
050:            private boolean externallyManaged;
051:
052:            private List<SectionDecorator> sectionsToDelete;
053:
054:            public void init() {
055:                super .init();
056:                // Determine whether this course is externally managed
057:                externallyManaged = getSectionManager().isExternallyManaged(
058:                        getCourse().getUuid());
059:
060:                // Generate the instructions for this user for the app in its current state
061:                if (externallyManaged) {
062:                    if (isSectionAssignable()) {
063:                        instructions = JsfUtil
064:                                .getLocalizedMessage("overview_instructions_auto_ta");
065:                    } else {
066:                        if (getApplicationConfiguration() == ExternalIntegrationConfig.AUTOMATIC_MANDATORY) {
067:                            instructions = JsfUtil
068:                                    .getLocalizedMessage("overview_instructions_mandatory_auto_instructor");
069:                        } else {
070:                            instructions = JsfUtil
071:                                    .getLocalizedMessage("overview_instructions_auto_instructor");
072:                        }
073:                    }
074:                } else {
075:                    instructions = "";
076:                }
077:            }
078:
079:            protected Comparator<SectionDecorator> getComparator() {
080:                String sortColumn = getPrefs().getOverviewSortColumn();
081:                boolean sortAscending = getPrefs().isOverviewSortAscending();
082:
083:                if (sortColumn.equals("title")) {
084:                    return SectionDecorator.getTitleComparator(sortAscending);
085:                } else if (sortColumn.equals("managers")) {
086:                    return SectionDecorator
087:                            .getManagersComparator(sortAscending);
088:                } else if (sortColumn.equals("totalEnrollments")) {
089:                    return SectionDecorator.getEnrollmentsComparator(
090:                            sortAscending, false);
091:                } else if (sortColumn.equals("available")) {
092:                    return SectionDecorator.getEnrollmentsComparator(
093:                            sortAscending, true);
094:                } else if (sortColumn.equals("meetingDays")) {
095:                    return SectionDecorator.getDayComparator(sortAscending);
096:                } else if (sortColumn.equals("meetingTimes")) {
097:                    return SectionDecorator.getTimeComparator(sortAscending);
098:                } else if (sortColumn.equals("location")) {
099:                    return SectionDecorator
100:                            .getLocationComparator(sortAscending);
101:                }
102:                log.error("Invalid sort specified.");
103:                return null;
104:            }
105:
106:            public String confirmDelete() {
107:                sectionsToDelete = new ArrayList<SectionDecorator>();
108:                for (Iterator<SectionDecorator> iter = sections.iterator(); iter
109:                        .hasNext();) {
110:                    SectionDecorator decoratedSection = iter.next();
111:                    if (decoratedSection.isFlaggedForRemoval()) {
112:                        sectionsToDelete.add(decoratedSection);
113:                    }
114:                }
115:                if (sectionsToDelete.isEmpty()) {
116:                    JsfUtil
117:                            .addErrorMessage(JsfUtil
118:                                    .getLocalizedMessage("overview_delete_section_choose"));
119:                    return null; // Don't go anywhere
120:                } else {
121:                    return "deleteSections";
122:                }
123:            }
124:
125:            public String deleteSections() {
126:                Set<String> set = new HashSet<String>();
127:                for (Iterator<SectionDecorator> iter = sectionsToDelete
128:                        .iterator(); iter.hasNext();) {
129:                    set.add(iter.next().getUuid());
130:                }
131:                getSectionManager().disbandSections(set);
132:                JsfUtil
133:                        .addRedirectSafeInfoMessage(JsfUtil
134:                                .getLocalizedMessage("overview_delete_section_success"));
135:                return "overview";
136:            }
137:
138:            public boolean isDeleteRendered() {
139:                return (!externallyManaged) && sections.size() > 0
140:                        && isSectionManagementEnabled();
141:            }
142:
143:            public boolean isExternallyManaged() {
144:                return externallyManaged;
145:            }
146:
147:            public List getSectionsToDelete() {
148:                return sectionsToDelete;
149:            }
150:
151:            @Override
152:            public String getSortColumn() {
153:                return getPrefs().getOverviewSortColumn();
154:            }
155:
156:            @Override
157:            public boolean isSortAscending() {
158:                return getPrefs().isOverviewSortAscending();
159:            }
160:
161:            @Override
162:            public void setSortAscending(boolean sortAscending) {
163:                getPrefs().setOverviewSortAscending(sortAscending);
164:            }
165:
166:            @Override
167:            public void setSortColumn(String sortColumn) {
168:                getPrefs().setOverviewSortColumn(sortColumn);
169:            }
170:
171:            @Override
172:            public String getCategoryFilter() {
173:                return getPrefs().getOverviewCategoryFilter();
174:            }
175:
176:            @Override
177:            public String getMyFilter() {
178:                return getPrefs().getOverviewMyFilter();
179:            }
180:
181:            @Override
182:            public void setCategoryFilter(String categoryFilter) {
183:                getPrefs().setOverviewCategoryFilter(categoryFilter);
184:            }
185:
186:            @Override
187:            public void setMyFilter(String myFilter) {
188:                getPrefs().setOverviewMyFilter(myFilter);
189:            }
190:
191:            public String getInstructions() {
192:                return instructions;
193:            }
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.