Source Code Cross Referenced for SettingsBean.java in  » Portal » Open-Portal » com » sun » portal » rssportlet » 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 » Portal » Open Portal » com.sun.portal.rssportlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: SettingsBean.java,v 1.2 2006/04/17 20:08:41 jtb Exp $
003:         * Copyright 2003 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.rssportlet;
014:
015:        import java.util.Locale;
016:        import java.util.LinkedList;
017:        import java.util.Collections;
018:
019:        /**
020:         * This class is a bean to hold the settings for the RSS portlet.
021:         *
022:         * This bean is prepared (populated) by an <code>SettingsHandler</class>
023:         * object, when it is set into the handler.
024:         *
025:         * In addition to normal getters and setters,
026:         * this class contains a set of <code>is*Set()</code> methods. These are used
027:         * to determine if the value for the field has been set into this bean. This
028:         * information is used to determine if the value has changed, and should
029:         * therefore be persisted.
030:         */
031:        public class SettingsBean {
032:            // use LinkedList, because we want to ensure a few optional List
033:            // operations are there
034:            private LinkedList feeds;
035:            private String selectedFeed = null;
036:            private String windowTarget = null;
037:            private Integer maxAge = null;
038:            private Integer cacheTimeout = null;
039:            private Integer maxDescriptionLength = null;
040:            private Boolean newWindow = null;
041:            private Boolean disableMaxAge = null;
042:            private Integer maxEntries = null;
043:            private Locale locale = null;
044:
045:            /** Get the selected feed. */
046:            public String getSelectedFeed() {
047:                return selectedFeed;
048:            }
049:
050:            /** Set the selected feed. */
051:            public void setSelectedFeed(String feed) {
052:                this .selectedFeed = feed;
053:            }
054:
055:            /**
056:             * Get the cache timeout.
057:             *
058:             * The cache timeout should be a positive number of seconds defining the
059:             * length in time that feed entries may be cached. It may also be equal to
060:             * zero indicating that the feed entries should never be cached. If the
061:             * value is negative, the feed entries may be cached forever.
062:             */
063:            public int getCacheTimeout() {
064:                return cacheTimeout.intValue();
065:            }
066:
067:            /** Set the cache timeout. */
068:            public void setCacheTimeout(int timeout) {
069:                this .cacheTimeout = new Integer(timeout);
070:            }
071:
072:            /**
073:             * Get the maximum description length.
074:             *
075:             * This determines the number of characters that will be displayed for a
076:             * feed's description. This is to prevent the portal display from being
077:             * adversely affected in the case where the feed entries contain
078:             * a very long description.
079:             */
080:            public int getMaxDescriptionLength() {
081:                return maxDescriptionLength.intValue();
082:            }
083:
084:            /** Set the maximum description length. */
085:            public void setMaxDescriptionLength(int length) {
086:                this .maxDescriptionLength = new Integer(length);
087:            }
088:
089:            /** Should feed links be opened in a new window? */
090:            public boolean isNewWindow() {
091:                return newWindow.booleanValue();
092:            }
093:
094:            /** Has the new window value been set into this bean? */
095:            public boolean isNewWindowSet() {
096:                return newWindow != null;
097:            }
098:
099:            /** Set if feed links should be opened in a new window. */
100:            public void setNewWindow(boolean nw) {
101:                this .newWindow = new Boolean(nw);
102:            }
103:
104:            /** Get the window target for feed links.
105:             *
106:             * This has no respective setter, and is based on the return value
107:             * of <code>isNewWindow()</code>. If said method returns true,
108:             * this method returns the string "_blank", else it returns "_top".
109:             */
110:            public String getWindowTarget() {
111:                String target = null;
112:                if (isNewWindow()) {
113:                    target = "_blank";
114:                } else {
115:                    target = "_top";
116:                }
117:
118:                return target;
119:            }
120:
121:            /**
122:             * Get the start feed.
123:             *
124:             * The start feed is the initial feed which is displayed when the user
125:             * logs in to the portal.
126:             */
127:            public String getStartFeed() {
128:                if (getFeeds().isEmpty()) {
129:                    return null;
130:                }
131:                return (String) getFeeds().get(0);
132:            }
133:
134:            /**
135:             * Set the start feed.
136:             *
137:             * This method removes the feed from the feeds list, if it exists there
138:             * currently, and adds it at the beginning of the list.
139:             */
140:            public void setStartFeed(String feed) {
141:                getFeeds().remove(feed);
142:                getFeeds().add(0, feed);
143:            }
144:
145:            /** Get all configured feeds. */
146:            public LinkedList getFeeds() {
147:                return feeds;
148:            }
149:
150:            /** Set all configured feeds. */
151:            public void setFeeds(LinkedList feeds) {
152:                if (feeds == null) {
153:                    // make sure the getter never returns null;
154:                    feeds = new LinkedList();
155:                }
156:                this .feeds = feeds;
157:            }
158:
159:            /**
160:             * Get the size of the feeds set.
161:             *
162:             * As opposed to calling <code>getFeeds().size()</code>, this is provided
163:             * for bean access within the display logic, as the Java
164:             * <code>Collection.size()</code> method is not bean-conforming.
165:             *
166:             * This methos simply returns <code>getFeeds().size()</code>.
167:             */
168:            public int getFeedsSize() {
169:                return getFeeds().size();
170:            }
171:
172:            /**
173:             * Get the maximum feed entry age for display.
174:             *
175:             * The display logic should not display any feed entries
176:             * that were published more than this number of hours
177:             * previous to now.
178:             */
179:            public int getMaxAge() {
180:                return maxAge.intValue();
181:            }
182:
183:            /** Set the maximum feed entry age. */
184:            public void setMaxAge(int age) {
185:                this .maxAge = new Integer(age);
186:            }
187:
188:            /**
189:             * Is the maximum feed entry age value set into this bean?
190:             */
191:            public boolean isMaxAgeSet() {
192:                return maxAge != null;
193:            }
194:
195:            /**
196:             * Is the maximum age restriction disabled?
197:             *
198:             * If so, the display logic will ignore the maximum age setting
199:             * and display entries up to the number of maximum entries allowed.
200:             */
201:            public boolean isDisableMaxAge() {
202:                return disableMaxAge.booleanValue();
203:            }
204:
205:            /** Set if the maximum age restriction is enabled. */
206:            public void setDisableMaxAge(boolean disableMaxAge) {
207:                this .disableMaxAge = new Boolean(disableMaxAge);
208:            }
209:
210:            /** Is the maximum age restriction disabled flag set into this bean? */
211:            public boolean isDisableMaxAgeSet() {
212:                return disableMaxAge != null;
213:            }
214:
215:            /** Get the maximum entries that will be displayed. */
216:            public int getMaxEntries() {
217:                return maxEntries.intValue();
218:            }
219:
220:            /** Set the maximum entries that will be displayed. */
221:            public void setMaxEntries(int maxEntries) {
222:                this .maxEntries = new Integer(maxEntries);
223:            }
224:
225:            /** Is the maximum entries value set into this bean? */
226:            public boolean isMaxEntriesSet() {
227:                return maxEntries != null;
228:            }
229:
230:            public Locale getLocale() {
231:                return locale;
232:            }
233:
234:            public void setLocale(Locale locale) {
235:                this.locale = locale;
236:            }
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.