Source Code Cross Referenced for TopicDO.java in  » Groupware » ivatagroupware » com » ivata » groupware » business » library » topic » 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 » Groupware » ivatagroupware » com.ivata.groupware.business.library.topic 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2001 - 2005 ivata limited.
003:         * All rights reserved.
004:         * -----------------------------------------------------------------------------
005:         * ivata groupware may be redistributed under the GNU General Public
006:         * License as published by the Free Software Foundation;
007:         * version 2 of the License.
008:         *
009:         * These programs are free software; you can redistribute them and/or
010:         * modify them under the terms of the GNU General Public License
011:         * as published by the Free Software Foundation; version 2 of the License.
012:         *
013:         * These programs are distributed in the hope that they will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         *
017:         * See the GNU General Public License in the file LICENSE.txt for more
018:         * details.
019:         *
020:         * If you would like a copy of the GNU General Public License write to
021:         *
022:         * Free Software Foundation, Inc.
023:         * 59 Temple Place - Suite 330
024:         * Boston, MA 02111-1307, USA.
025:         *
026:         *
027:         * To arrange commercial support and licensing, contact ivata at
028:         *                  http://www.ivata.com/contact.jsp
029:         * -----------------------------------------------------------------------------
030:         * $Log: TopicDO.java,v $
031:         * Revision 1.4  2005/04/29 02:48:16  colinmacleod
032:         * Data bugfixes.
033:         * Changed primary key back to Integer.
034:         *
035:         * Revision 1.3  2005/04/10 20:31:57  colinmacleod
036:         * Added new themes.
037:         * Changed id type to String.
038:         * Changed i tag to em and b tag to strong.
039:         * Improved PicoContainerFactory with NanoContainer scripts.
040:         *
041:         * Revision 1.2  2005/04/09 17:19:46  colinmacleod
042:         * Changed copyright text to GPL v2 explicitly.
043:         *
044:         * Revision 1.1.1.1  2005/03/10 17:52:06  colinmacleod
045:         * Restructured ivata op around Hibernate/PicoContainer.
046:         * Renamed ivata groupware.
047:         *
048:         * Revision 1.3  2004/07/13 19:47:29  colinmacleod
049:         * Moved project to POJOs from EJBs.
050:         * Applied PicoContainer to services layer (replacing session EJBs).
051:         * Applied Hibernate to persistence layer (replacing entity EJBs).
052:         *
053:         * Revision 1.2  2004/03/21 21:16:29  colinmacleod
054:         * Shortened name to ivata op.
055:         *
056:         * Revision 1.1.1.1  2004/01/27 20:58:43  colinmacleod
057:         * Moved ivata openportal to SourceForge..
058:         *
059:         * Revision 1.2  2003/10/15 14:16:53  colin
060:         * fixing for XDoclet
061:         *
062:         * Revision 1.2  2003/06/04 09:28:36  colin
063:         * made comparable
064:         *
065:         * Revision 1.1  2003/02/24 19:09:24  colin
066:         * moved to business
067:         *
068:         * Revision 1.4  2003/02/04 17:43:50  colin
069:         * copyright notice
070:         *
071:         * Revision 1.3  2003/01/08 10:40:14  jano
072:         * we changed interface of libraryBeans, we are using libraryRightBean for amending rights and for finding out
073:         * and we are not storing rights in TopicDO
074:         *
075:         * Revision 1.2  2002/12/03 09:44:54  jano
076:         * I added rights for TOPIC
077:         *
078:         * Revision 1.1  2002/11/28 14:12:15  jano
079:         * we need because it's better pass one object as many Strings
080:         *
081:         * Revision 1.2  2002/11/26 14:56:31  jano
082:         * -----------------------------------------------------------------------------
083:         */
084:        package com.ivata.groupware.business.library.topic;
085:
086:        import com.ivata.groupware.container.persistence.BaseDO;
087:
088:        /**
089:         * <p>Represents a topic which can be used for a library item. Each library item
090:         * in ivata groupware must have a topic associated with it, and this is important
091:         * as access to each item is granted or denied on the basis of the topic
092:         * associated with it.</p>
093:         *
094:         * @since   2002-11-26
095:         * @author  jano
096:         * @version $Revision: 1.4 $
097:         *
098:         * @hibernate.class
099:         *      table="library_topic"
100:         */
101:        public class TopicDO extends BaseDO implements  Comparable {
102:
103:            /**
104:             * <p>Briefly describes the topic in one line.</p>
105:             */
106:            private String caption;
107:
108:            /**
109:             * <p>Name of image file.</p>
110:             */
111:            private String image;
112:
113:            /**
114:             * <p>Comparison method. See if the object supplied is a topic dependent
115:             * object and, if so, whether or not its contents are greater than, the same
116:             * or less than this one.</p>
117:             *
118:             * <p>This method sorts by the caption first then the id.</p>
119:             *
120:             * @param compare the object to compare with this one.
121:             * @return a positive number if the object supplied in <code>compare</code>
122:             *     is greater than this one, <code>0</code> if they are the same,
123:             *     otherwise a negative number.
124:             */
125:            public int compareTo(final Object compare) {
126:                // first check it is non-null and the class is right
127:                if ((compare == null) || !(this .getClass().isInstance(compare))) {
128:                    return 1;
129:                }
130:
131:                TopicDO topicDO = (TopicDO) compare;
132:                Integer id = getId();
133:                Integer topicId = topicDO.getId();
134:
135:                // see the ids are the same
136:                if (((id == null) ? (topicId == null) : id.equals(topicId))) {
137:                    return 0;
138:                }
139:
140:                // see if the captions are equal - if so, use the id
141:                if (((caption == null) ? (topicDO.caption == null) : caption
142:                        .equals(topicDO.caption))) {
143:                    // if the id is null and the other id is not null, return +ve
144:                    if (id == null) {
145:                        return 1;
146:                    }
147:
148:                    return 0;
149:                }
150:
151:                // if the name is null and the other name is not null, return +ve
152:                if (caption == null) {
153:                    return 1;
154:                }
155:
156:                // otherwise, compare the names
157:                return caption.compareTo(topicDO.caption);
158:            }
159:
160:            /**
161:             * <p>Briefly describes the topic in one line.</p>
162:             *
163:             * @return current value of caption.
164:             * @hibernate.property
165:             */
166:            public final String getCaption() {
167:                return caption;
168:            }
169:
170:            /**
171:             * <p>Name of image file.</p>
172:             *
173:             * @return image file name.
174:             * @hibernate.property
175:             */
176:            public String getImage() {
177:                return image;
178:            }
179:
180:            /**
181:             * <p>Briefly describes the topic in one line.</p>
182:             *
183:             * @param caption new value of caption.
184:             */
185:            public final void setCaption(final String caption) {
186:                this .caption = caption;
187:            }
188:
189:            /**
190:             * <p>Name of image file.</p>
191:             *
192:             * @param image new image file name.
193:             */
194:            public final void setImage(final String image) {
195:                this.image = image;
196:            }
197:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.