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


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/podcasts/tags/sakai_2-4-1/podcasts-app/src/java/org/sakaiproject/tool/podcasts/podOptionsBean.java $
003:         * $Id: podOptionsBean.java 14691 2006-09-15 12:36:27Z josrodri@iupui.edu$
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
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.podcasts;
021:
022:        import java.util.Locale;
023:        import java.util.ResourceBundle;
024:
025:        import javax.faces.application.FacesMessage;
026:        import javax.faces.context.FacesContext;
027:        import javax.faces.model.SelectItem;
028:
029:        import org.sakaiproject.api.app.podcasts.PodcastService;
030:
031:        public class podOptionsBean {
032:            private int podOption;
033:
034:            /** Used to acccess podcast service functions */
035:            private PodcastService podcastService;
036:
037:            /** Used to access message bundle */
038:            private final String MESSAGE_BUNDLE = "org.sakaiproject.api.podcasts.bundle.Messages";
039:
040:            private static final int PUBLIC = 0;
041:            private static final int SITE = 1;
042:            private static final String OPTIONS_PUBLIC = "options_public";
043:            private static final String OPTIONS_SITE = "options_site";
044:            private static final String CHANGE_TO_SITE = "option_change_confirm";
045:
046:            private SelectItem[] displayItems = new SelectItem[] {
047:                    new SelectItem(new Integer(PUBLIC),
048:                            getMessageString(OPTIONS_PUBLIC)),
049:                    new SelectItem(new Integer(SITE),
050:                            getMessageString(OPTIONS_SITE)) };
051:
052:            public podOptionsBean() {
053:                podOption = 0;
054:            }
055:
056:            /** Returns whether podcast folder is PUBLIC (0) or SITE (1) **/
057:            public int getPodOption() {
058:                return podcastService.getOptions();
059:            }
060:
061:            /** Set whether the podcast folder is PUBLIC (0) or SITE (1) **/
062:            public void setPodOption(int option) {
063:                podOption = option;
064:            }
065:
066:            /** Returns the options of what the podcast folder can be set to **/
067:            public SelectItem[] getDisplayItems() {
068:                return displayItems;
069:            }
070:
071:            /**
072:             * Set the podcast folder to either:
073:             * 	0	Display to non-members (PUBLIC)
074:             *  1	Display to Site (SITE)
075:             * @return String
076:             * 			Used for navigation to go back to main page
077:             */
078:            public String processOptionChange() {
079:
080:                podcastService.reviseOptions(podOption == PUBLIC);
081:
082:                if (podOption == SITE) {
083:                    // Set the display message because changed to Display to Site
084:                    setErrorMessage(CHANGE_TO_SITE);
085:
086:                }
087:
088:                return "cancel";
089:            }
090:
091:            /** Returns back to main page with no changes **/
092:            public String processOptionCancel() {
093:                return "cancel";
094:            }
095:
096:            /**
097:             * Returns the message pulled from the MessageBundle using
098:             * the name passed in
099:             * 
100:             * @param key 
101:             * 			The name in the MessageBundle for the message wanted
102:             * @return String
103:             * 			The string that is the value of the message
104:             */
105:            private String getMessageString(String key) {
106:                ResourceBundle rb = ResourceBundle.getBundle(MESSAGE_BUNDLE);
107:                return rb.getString(key);
108:
109:            }
110:
111:            /**
112:             * @param podcastService The podcastService to set.
113:             */
114:            public void setPodcastService(PodcastService podcastService) {
115:                this .podcastService = podcastService;
116:            }
117:
118:            /**
119:             * Passes an error message to the Spring framework to display on page.
120:             * 
121:             * @param alertMsg The key to get the message from the message bundle 
122:             */
123:            private void setErrorMessage(String alertMsg) {
124:                FacesContext.getCurrentInstance()
125:                        .addMessage(
126:                                null,
127:                                new FacesMessage("Alert: "
128:                                        + getMessageString(alertMsg)));
129:            }
130:
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.