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


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/TopicImpl.java $
003:         * $Id: TopicImpl.java 9227 2006-05-15 15:02:42Z cwen@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.component.app.messageforums.dao.hibernate;
021:
022:        import java.util.Comparator;
023:        import java.util.Date;
024:        import java.util.HashSet;
025:        import java.util.List;
026:        import java.util.Set;
027:
028:        import org.apache.commons.logging.Log;
029:        import org.apache.commons.logging.LogFactory;
030:        import org.sakaiproject.api.app.messageforums.Attachment;
031:        import org.sakaiproject.api.app.messageforums.BaseForum;
032:        import org.sakaiproject.api.app.messageforums.DBMembershipItem;
033:        import org.sakaiproject.api.app.messageforums.Message;
034:        import org.sakaiproject.api.app.messageforums.OpenForum;
035:        import org.sakaiproject.api.app.messageforums.PermissionLevel;
036:        import org.sakaiproject.api.app.messageforums.PrivateForum;
037:        import org.sakaiproject.api.app.messageforums.Topic;
038:
039:        public abstract class TopicImpl extends MutableEntityImpl implements 
040:                Topic {
041:
042:            private static final Log LOG = LogFactory.getLog(TopicImpl.class);
043:
044:            private String title;
045:            private String shortDescription;
046:            private String extendedDescription;
047:            private Set attachmentsSet;// = new HashSet();
048:            private Boolean mutable;
049:            private Integer sortIndex;
050:            private String typeUuid;
051:            private BaseForum baseForum;
052:            private Set messagesSet;// = new HashSet();
053:            private Set membershipItemSet;
054:            private String defaultAssignName;
055:            private Boolean moderated;
056:
057:            // foreign keys for hibernate
058:            private PrivateForum privateForum;
059:            private OpenForum openForum;
060:
061:            // indecies for hibernate
062:            //private int ofindex;
063:            //private int pfindex;   
064:
065:            public List getMessages() {
066:                return Util.setToList(messagesSet);
067:            }
068:
069:            public void setMessages(List messages) {
070:                this .messagesSet = Util.listToSet(messages);
071:            }
072:
073:            public Set getMessagesSet() {
074:                return messagesSet;
075:            }
076:
077:            public void setMessagesSet(Set messagesSet) {
078:                this .messagesSet = messagesSet;
079:            }
080:
081:            public Set getAttachmentsSet() {
082:                return attachmentsSet;
083:            }
084:
085:            public void setAttachmentsSet(Set attachmentsSet) {
086:                this .attachmentsSet = attachmentsSet;
087:            }
088:
089:            public List getAttachments() {
090:                return Util.setToList(attachmentsSet);
091:            }
092:
093:            public void setAttachments(List attachments) {
094:                this .attachmentsSet = Util.listToSet(attachments);
095:            }
096:
097:            public Set getMembershipItemSet() {
098:                return membershipItemSet;
099:            }
100:
101:            public void setMembershipItemSet(Set membershipItemSet) {
102:                this .membershipItemSet = membershipItemSet;
103:            }
104:
105:            public String getExtendedDescription() {
106:                return extendedDescription;
107:            }
108:
109:            public void setExtendedDescription(String extendedDescription) {
110:                this .extendedDescription = extendedDescription;
111:            }
112:
113:            public Boolean getMutable() {
114:                return mutable;
115:            }
116:
117:            public void setMutable(Boolean mutable) {
118:                this .mutable = mutable;
119:            }
120:
121:            public String getShortDescription() {
122:                return shortDescription;
123:            }
124:
125:            public void setShortDescription(String shortDescription) {
126:                this .shortDescription = shortDescription;
127:            }
128:
129:            public Integer getSortIndex() {
130:                return sortIndex;
131:            }
132:
133:            public void setSortIndex(Integer sortIndex) {
134:                this .sortIndex = sortIndex;
135:            }
136:
137:            public String getTitle() {
138:                return title;
139:            }
140:
141:            public void setTitle(String title) {
142:                this .title = title;
143:            }
144:
145:            public String getTypeUuid() {
146:                return typeUuid;
147:            }
148:
149:            public void setTypeUuid(String typeUuid) {
150:                this .typeUuid = typeUuid;
151:            }
152:
153:            public BaseForum getBaseForum() {
154:                return baseForum;
155:            }
156:
157:            public void setBaseForum(BaseForum forum) {
158:                this .baseForum = forum;
159:            }
160:
161:            public OpenForum getOpenForum() {
162:                return openForum;
163:            }
164:
165:            public void setOpenForum(OpenForum openForum) {
166:                this .openForum = openForum;
167:            }
168:
169:            public PrivateForum getPrivateForum() {
170:                return privateForum;
171:            }
172:
173:            public void setPrivateForum(PrivateForum privateForum) {
174:                this .privateForum = privateForum;
175:            }
176:
177:            public Boolean getModerated() {
178:                return moderated;
179:            }
180:
181:            public void setModerated(Boolean moderated) {
182:                this .moderated = moderated;
183:            }
184:
185:            //    public int getOfindex() {
186:            //        try {
187:            //            return getOpenForum().getTopics().indexOf(this);
188:            //        } catch (Exception e) {
189:            //            return ofindex;
190:            //        }
191:            //    }
192:            //
193:            //    public void setOfindex(int ofindex) {
194:            //        this.ofindex = ofindex;
195:            //    }
196:            //
197:            //    public int getPfindex() {
198:            //        try {
199:            //            return getPrivateForum().getTopics().indexOf(this);
200:            //        } catch (Exception e) {
201:            //            return pfindex;
202:            //        }
203:            //    }
204:            //
205:            //    public void setPfindex(int pfindex) {
206:            //        this.pfindex = pfindex;
207:            //    }
208:
209:            public String toString() {
210:                return "Topic/" + id;
211:                //return "Topic.id:" + id;
212:            }
213:
214:            public boolean equals(Object obj) {
215:                if (obj != null && obj instanceof  Topic) {
216:                    return getId().equals(((Topic) obj).getId());
217:                }
218:                return false;
219:            }
220:
221:            // needs a better impl
222:            public int hashCode() {
223:                return getId() == null ? 0 : getId().hashCode();
224:            }
225:
226:            ////////////////////////////////////////////////////////////////////////
227:            // helper methods for collections
228:            ////////////////////////////////////////////////////////////////////////
229:
230:            public void addMessage(Message message) {
231:                if (LOG.isDebugEnabled()) {
232:                    LOG.debug("addForum(message " + message + ")");
233:                }
234:
235:                if (message == null) {
236:                    throw new IllegalArgumentException("message == null");
237:                }
238:
239:                if (messagesSet == null) {
240:                    messagesSet = new HashSet();
241:                }
242:                message.setTopic(this );
243:                messagesSet.add(message);
244:            }
245:
246:            public void removeMessage(Message message) {
247:                if (LOG.isDebugEnabled()) {
248:                    LOG.debug("removeForum(message " + message + ")");
249:                }
250:
251:                if (message == null) {
252:                    throw new IllegalArgumentException(
253:                            "Illegal message argument passed!");
254:                }
255:
256:                message.setTopic(null);
257:                messagesSet.remove(message);
258:            }
259:
260:            public void addAttachment(Attachment attachment) {
261:                if (LOG.isDebugEnabled()) {
262:                    LOG.debug("addAttachment(Attachment " + attachment + ")");
263:                }
264:
265:                if (attachment == null) {
266:                    throw new IllegalArgumentException("attachment == null");
267:                }
268:
269:                if (attachmentsSet == null) {
270:                    attachmentsSet = new HashSet();
271:                }
272:                attachment.setTopic(this );
273:                attachmentsSet.add(attachment);
274:            }
275:
276:            public void removeAttachment(Attachment attachment) {
277:                if (LOG.isDebugEnabled()) {
278:                    LOG
279:                            .debug("removeAttachment(Attachment " + attachment
280:                                    + ")");
281:                }
282:
283:                if (attachment == null) {
284:                    throw new IllegalArgumentException(
285:                            "Illegal attachment argument passed!");
286:                }
287:
288:                attachment.setTopic(null);
289:                attachmentsSet.remove(attachment);
290:            }
291:
292:            public void addMembershipItem(DBMembershipItem item) {
293:                if (LOG.isDebugEnabled()) {
294:                    LOG.debug("addMembershipItem(item " + item + ")");
295:                }
296:
297:                if (item == null) {
298:                    throw new IllegalArgumentException("item == null");
299:                }
300:
301:                if (membershipItemSet == null) {
302:                    membershipItemSet = new HashSet();
303:                }
304:                membershipItemSet.add(item);
305:            }
306:
307:            public void removeMembershipItem(DBMembershipItem item) {
308:                if (LOG.isDebugEnabled()) {
309:                    LOG.debug("removeMembershipItem(item " + item + ")");
310:                }
311:
312:                if (item == null) {
313:                    throw new IllegalArgumentException(
314:                            "Illegal level argument passed!");
315:                }
316:
317:                membershipItemSet.remove(item);
318:            }
319:
320:            public String getDefaultAssignName() {
321:                return defaultAssignName;
322:            }
323:
324:            public void setDefaultAssignName(String defaultAssignName) {
325:                this.defaultAssignName = defaultAssignName;
326:            }
327:
328:        }
w__w___w_._j_a__v_a2__s___.c___o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.