Source Code Cross Referenced for SelectGradebookBean.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » tool » gradebook » ui » standalone » 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.gradebook.ui.standalone 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         *
003:         * $Id: SelectGradebookBean.java 8234 2006-04-25 01:18:48Z ray@media.berkeley.edu $
004:         *
005:         ***********************************************************************************
006:         *
007:         * Copyright (c) 2005, 2006 The Regents of the University of California, The MIT Corporation
008:         *
009:         * Licensed under the Educational Community License, Version 1.0 (the "License");
010:         * you may not use this file except in compliance with the License.
011:         * You may obtain a copy of the License at
012:         *
013:         *      http://www.opensource.org/licenses/ecl1.php
014:         *
015:         * Unless required by applicable law or agreed to in writing, software
016:         * distributed under the License is distributed on an "AS IS" BASIS,
017:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018:         * See the License for the specific language governing permissions and
019:         * limitations under the License.
020:         *
021:         **********************************************************************************/package org.sakaiproject.tool.gradebook.ui.standalone;
022:
023:        import java.io.UnsupportedEncodingException;
024:        import java.net.URLEncoder;
025:        import java.util.ArrayList;
026:        import java.util.Iterator;
027:        import java.util.List;
028:
029:        import org.apache.commons.logging.Log;
030:        import org.apache.commons.logging.LogFactory;
031:        import org.sakaiproject.tool.gradebook.Gradebook;
032:        import org.sakaiproject.tool.gradebook.facades.Authn;
033:        import org.sakaiproject.tool.gradebook.ui.InitializableBean;
034:
035:        public class SelectGradebookBean extends InitializableBean {
036:            private static final Log logger = LogFactory
037:                    .getLog(SelectGradebookBean.class);
038:            private Authn authnService;
039:            private FrameworkManager frameworkManager;
040:
041:            /**
042:             * Return a list of gradebooks accessible by the currently logged-in user.
043:             */
044:            public List getGradebooks() {
045:                String userUid = authnService.getUserUid();
046:                List gradebooks = frameworkManager
047:                        .getAccessibleGradebooks(userUid);
048:
049:                // JSF's "f:param" doesn't java.net.URLEncoder.encode the
050:                // parameter value for us. If it did, we would just return the gradebooks
051:                // list straight.
052:                List returnList = new ArrayList(gradebooks.size());
053:                for (Iterator iter = gradebooks.iterator(); iter.hasNext();) {
054:                    Gradebook gradebook = (Gradebook) iter.next();
055:                    returnList.add(new GradebookRow(gradebook));
056:                }
057:
058:                return returnList;
059:            }
060:
061:            public class GradebookRow {
062:                private String name;
063:                private String uid;
064:
065:                public GradebookRow() {
066:                }
067:
068:                public GradebookRow(Gradebook gradebook) {
069:                    this .name = gradebook.getName();
070:                    try {
071:                        this .uid = URLEncoder.encode(gradebook.getUid(),
072:                                "UTF-8");
073:                    } catch (UnsupportedEncodingException ex) {
074:                        logger.error("Unlikely exception thrown", ex);
075:                    }
076:                }
077:
078:                public String getName() {
079:                    return name;
080:                }
081:
082:                public void setName(String name) {
083:                    this .name = name;
084:                }
085:
086:                public String getUid() {
087:                    return uid;
088:                }
089:
090:                public void setUid(String uid) {
091:                    this .uid = uid;
092:                }
093:            }
094:
095:            public Authn getAuthnService() {
096:                return authnService;
097:            }
098:
099:            public void setAuthnService(Authn authnService) {
100:                this .authnService = authnService;
101:            }
102:
103:            public FrameworkManager getFrameworkManager() {
104:                return frameworkManager;
105:            }
106:
107:            public void setFrameworkManager(FrameworkManager frameworkManager) {
108:                this.frameworkManager = frameworkManager;
109:            }
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.