Source Code Cross Referenced for ResourceBean.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » component » app » help » model » 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.component.app.help.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/help/tags/sakai_2-4-1/help-component-shared/src/java/org/sakaiproject/component/app/help/model/ResourceBean.java $
003:         * $Id: ResourceBean.java 7653 2006-04-12 12:10:02Z marquard@ched.uct.ac.za $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004 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.component.app.help.model;
021:
022:        import java.net.MalformedURLException;
023:        import java.net.URL;
024:        import java.util.HashSet;
025:        import java.util.Set;
026:
027:        import org.sakaiproject.api.app.help.Category;
028:        import org.sakaiproject.api.app.help.Resource;
029:
030:        /**
031:         * resource bean
032:         * @version $Id: ResourceBean.java 7653 2006-04-12 12:10:02Z marquard@ched.uct.ac.za $
033:         */
034:        public class ResourceBean implements  Resource, Comparable {
035:            private Long id;
036:            private String docId;
037:            private String name;
038:            private Set contexts = new HashSet();
039:            private String location;
040:            private String source;
041:            private Long tstamp;
042:            private float score;
043:            private String formattedScore;
044:            private String defaultForTool;
045:            private String welcomePage;
046:            private Category category;
047:
048:            /**
049:             * get id
050:             * @return Returns the id.
051:             */
052:            public Long getId() {
053:                return id;
054:            }
055:
056:            /**
057:             * set id
058:             * @param id The id to set.
059:             */
060:            public void setId(Long id) {
061:                this .id = id;
062:            }
063:
064:            /**
065:             * @see org.sakaiproject.api.app.help.Resource#getDocId()
066:             */
067:            public String getDocId() {
068:                return docId;
069:            }
070:
071:            /**
072:             * @see org.sakaiproject.api.app.help.Resource#setDocId(java.lang.String)
073:             */
074:            public void setDocId(String docId) {
075:                this .docId = docId;
076:            }
077:
078:            /**
079:             * @see org.sakaiproject.api.app.help.Resource#getLocation()
080:             */
081:            public String getLocation() {
082:                return location;
083:            }
084:
085:            /**
086:             * @see org.sakaiproject.api.app.help.Resource#setLocation(java.lang.String)
087:             */
088:            public void setLocation(String location) {
089:                this .location = location;
090:            }
091:
092:            /**
093:             * @see org.sakaiproject.api.app.help.Resource#getContexts()
094:             */
095:            public Set getContexts() {
096:                return contexts;
097:            }
098:
099:            /**
100:             * @see org.sakaiproject.api.app.help.Resource#setContexts(java.util.Set)
101:             */
102:            public void setContexts(Set contexts) {
103:                this .contexts = contexts;
104:            }
105:
106:            /**
107:             * @see org.sakaiproject.api.app.help.Resource#getUrl()
108:             */
109:            public URL getUrl() throws MalformedURLException {
110:                return new URL(getLocation());
111:            }
112:
113:            /**
114:             * @see org.sakaiproject.api.app.help.Resource#getName()
115:             */
116:            public String getName() {
117:                return name;
118:            }
119:
120:            /**
121:             * @see org.sakaiproject.api.app.help.Resource#setName(java.lang.String)
122:             */
123:            public void setName(String name) {
124:                this .name = name;
125:            }
126:
127:            /**
128:             * @see org.sakaiproject.api.app.help.Resource#getSource()
129:             */
130:            public String getSource() {
131:                return source;
132:            }
133:
134:            /**
135:             * @see org.sakaiproject.api.app.help.Resource#setSource(java.lang.String)
136:             */
137:            public void setSource(String source) {
138:                this .source = source;
139:            }
140:
141:            /**
142:             * @see org.sakaiproject.api.app.help.Resource#getTstamp()
143:             */
144:            public Long getTstamp() {
145:                return tstamp;
146:            }
147:
148:            /**
149:             * @see org.sakaiproject.api.app.help.Resource#setTstamp(java.lang.Long)
150:             */
151:            public void setTstamp(Long tstamp) {
152:                this .tstamp = tstamp;
153:            }
154:
155:            /**
156:             * @see org.sakaiproject.api.app.help.Resource#getScore()
157:             */
158:            public float getScore() {
159:                return score;
160:            }
161:
162:            /**
163:             * @see org.sakaiproject.api.app.help.Resource#setScore(float)
164:             */
165:            public void setScore(float score) {
166:                this .score = score;
167:            }
168:
169:            /**
170:             * @see org.sakaiproject.api.app.help.Resource#getDefaultForTool()
171:             */
172:            public String getDefaultForTool() {
173:                return defaultForTool;
174:            }
175:
176:            /**
177:             * @see org.sakaiproject.api.app.help.Resource#setDefaultForTool(java.lang.String)
178:             */
179:            public void setDefaultForTool(String defaultForTool) {
180:                this .defaultForTool = defaultForTool;
181:            }
182:
183:            /**
184:             * @see org.sakaiproject.api.app.help.Resource#getFormattedScore()
185:             */
186:            public String getFormattedScore() {
187:                formattedScore = String.valueOf(score);
188:                int index = formattedScore.indexOf(".");
189:                formattedScore = formattedScore.substring(0, index + 2);
190:                return formattedScore + "%";
191:            }
192:
193:            /**
194:             * @see java.lang.Comparable#compareTo(java.lang.Object)
195:             */
196:            public int compareTo(Object object) {
197:                ResourceBean resourceBean = (ResourceBean) object;
198:                if (resourceBean.score != 0) {
199:                    return Float.compare(resourceBean.score, score);
200:                } else {
201:                    return (id.compareTo(resourceBean.id));
202:                }
203:            }
204:
205:            /**
206:             * business key 
207:             * @return businessKey
208:             */
209:            private String businessKey() {
210:                StringBuffer sb = new StringBuffer();
211:                sb.append(docId);
212:                return sb.toString();
213:            }
214:
215:            /**
216:             * @see java.lang.Object#equals(java.lang.Object)
217:             */
218:            public boolean equals(Object obj) {
219:                if (this  == obj)
220:                    return true;
221:                if (!(obj instanceof  ResourceBean))
222:                    return false;
223:                ResourceBean other = (ResourceBean) obj;
224:                return this .businessKey().equals(other.businessKey());
225:            }
226:
227:            /**
228:             * @see java.lang.Object#hashCode()
229:             */
230:            public int hashCode() {
231:                return businessKey().hashCode();
232:            }
233:
234:            /**
235:             * @see java.lang.Object#toString()
236:             */
237:            public String toString() {
238:                StringBuffer sb = new StringBuffer();
239:                sb.append("docId=");
240:                sb.append(docId);
241:                sb.append(", name=");
242:                sb.append(name);
243:                sb.append(", location=");
244:                sb.append(location);
245:                sb.append(", defaultForTool=");
246:                sb.append(defaultForTool);
247:                sb.append(", welcomePage=");
248:                sb.append(welcomePage);
249:                sb.append(", source=");
250:                sb.append(source);
251:                return sb.toString();
252:            }
253:
254:            /**
255:             * get category
256:             * @return Returns the category.
257:             */
258:            public Category getCategory() {
259:                return category;
260:            }
261:
262:            /**
263:             * set category
264:             * @param category The category to set.
265:             */
266:            public void setCategory(Category category) {
267:                this .category = category;
268:            }
269:
270:            public String getWelcomePage() {
271:                return welcomePage;
272:            }
273:
274:            public void setWelcomePage(String welcomePage) {
275:                this.welcomePage = welcomePage;
276:            }
277:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.