Source Code Cross Referenced for podFeedBean.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/podFeedBean.java $
003:         * $Id: podFeedBean.java 18624 2006-12-04 20:15:46Z 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:
028:        import org.sakaiproject.api.app.podcasts.PodfeedService;
029:
030:        public class podFeedBean {
031:
032:            /** Used to pull messages from the bundle **/
033:            public static final String PODFEED_TITLE_MSG = "feed_title";
034:            public static final String PODFEED_DESC1 = "feed_desc1";
035:            public static final String PODFEED_DESC2 = "feed_desc2";
036:            public static final String NO_TITLE_ALERT = "notitle";
037:
038:            private final String MESSAGE_BUNDLE = "org.sakaiproject.api.podcasts.bundle.Messages";
039:
040:            // inject podfeedService into here to use
041:            private PodfeedService podfeedService;
042:
043:            // Used by podFeedRevise for global feed info
044:            private String podfeedTitle;
045:            private String podfeedDescription;
046:            private String feedCopyright;
047:            private String feedGenerator;
048:            private String language;
049:
050:            /**
051:             * Returns the global podcast title
052:             * 
053:             * @return String 
054:             *		The global podcast title
055:             */
056:            public String getPodfeedTitle() {
057:                podfeedTitle = podfeedService.getPodfeedTitle();
058:
059:                return podfeedTitle;
060:            }
061:
062:            /**
063:             * Setter for global podcast title
064:             * 
065:             * @param podFeedTitle 
066:             * 				The podFeedTitle to set.
067:             */
068:            public void setPodfeedTitle(String podFeedTitle) {
069:                this .podfeedTitle = podFeedTitle;
070:
071:            }
072:
073:            /**
074:             * Returns the global podcast description
075:             * 
076:             * @return String
077:             * 				Returns the podFeedDescription.
078:             */
079:            public String getPodfeedDescription() {
080:                podfeedDescription = podfeedService.getPodfeedDescription();
081:
082:                return podfeedDescription;
083:            }
084:
085:            /**
086:             * Setter for the global podcast description.
087:             * 
088:             * @param podFeedDescription 
089:             * 				The podFeedDescription to set.
090:             */
091:            public void setPodfeedDescription(String podFeedDescription) {
092:                this .podfeedDescription = podFeedDescription;
093:
094:            }
095:
096:            /**
097:             * Determine if revisions made to global feed info and apply changes.
098:             * 
099:             * @return String to control navigation
100:             */
101:            public String processRevisePodcast() {
102:                String whereToGo = "cancel";
103:
104:                final String oldTitle = podfeedService.getPodfeedTitle();
105:
106:                if (podfeedTitle != null && !podfeedTitle.equals(oldTitle)) {
107:                    if (podfeedTitle.equals("")) {
108:                        setErrorMessage(NO_TITLE_ALERT);
109:                        whereToGo = "podfeedRevise";
110:                    } else {
111:                        // Replace with this title
112:                        podfeedService.setPodfeedTitle(podfeedTitle);
113:                    }
114:                }
115:
116:                final String oldDescription = podfeedService
117:                        .getPodfeedDescription();
118:
119:                if (podfeedDescription != null
120:                        && !podfeedDescription.equals(oldDescription)) {
121:                    // Replace with this description
122:                    podfeedService.setPodfeedDescription(podfeedDescription);
123:                }
124:
125:                if (feedCopyright != null || !"".equals(feedCopyright)) {
126:                    podfeedService.setPodfeedCopyright(feedCopyright);
127:                }
128:
129:                if (feedGenerator != null || !"".equals(feedGenerator)) {
130:                    podfeedService.setPodfeedGenerator(feedGenerator);
131:                }
132:
133:                return whereToGo;
134:            }
135:
136:            /**
137:             * Cancels revising global podfeed information
138:             * 
139:             * @return String Sent to return to the main page
140:             */
141:            public String processCancelPodfeedRevise() {
142:                podfeedTitle = "";
143:                podfeedDescription = "";
144:
145:                return "cancel";
146:            }
147:
148:            /**
149:             * @return Returns the podfeedService.
150:             */
151:            public PodfeedService getPodfeedService() {
152:                return podfeedService;
153:            }
154:
155:            /**
156:             * @param podfeedService The podfeedService to set.
157:             */
158:            public void setPodfeedService(PodfeedService podfeedService) {
159:                this .podfeedService = podfeedService;
160:            }
161:
162:            /**
163:             * Passes an error message to the Spring framework to display on page.
164:             * 
165:             * @param alertMsg
166:             *            The key to get the message from the message bundle
167:             */
168:            private void setErrorMessage(String alertMsg) {
169:                FacesContext.getCurrentInstance().addMessage(
170:                        null,
171:                        new FacesMessage("Alert: "
172:                                + getErrorMessageString(alertMsg)));
173:            }
174:
175:            /**
176:             * Sets the Faces error message by pulling the message from the
177:             * MessageBundle using the name passed in
178:             * 
179:             * @param key
180:             *           The name in the MessageBundle for the message wanted
181:             *            
182:             * @return String
183:             * 			The string that is the value of the message
184:             */
185:            private String getErrorMessageString(String key) {
186:                ResourceBundle rb = ResourceBundle.getBundle(MESSAGE_BUNDLE);
187:                return rb.getString(key);
188:
189:            }
190:
191:            public String getFeedCopyright() {
192:                feedCopyright = podfeedService.getPodfeedCopyright();
193:
194:                return feedCopyright;
195:            }
196:
197:            public void setFeedCopyright(String feedCopyright) {
198:                this .feedCopyright = feedCopyright;
199:            }
200:
201:            public String getFeedGenerator() {
202:                feedGenerator = podfeedService.getPodfeedGenerator();
203:
204:                return feedGenerator;
205:            }
206:
207:            public void setFeedGenerator(String feedGenerator) {
208:                this .feedGenerator = feedGenerator;
209:            }
210:
211:            public String getLanguage() {
212:                return language;
213:            }
214:
215:            public void setLanguage(String language) {
216:                this.language = language;
217:            }
218:
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.