Source Code Cross Referenced for DiscussionMessageBean.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » tool » messageforums » ui » 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.messageforums.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-app/src/java/org/sakaiproject/tool/messageforums/ui/DiscussionMessageBean.java $
003:         * $Id: DiscussionMessageBean.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004, 2005, 2006, 2007 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.messageforums.ui;
021:
022:        import java.util.ArrayList;
023:        import java.util.List;
024:
025:        import org.sakaiproject.api.app.messageforums.Attachment;
026:        import org.sakaiproject.api.app.messageforums.Message;
027:
028:        import org.sakaiproject.component.cover.ComponentManager;
029:        import org.sakaiproject.tool.cover.SessionManager;
030:        import org.sakaiproject.api.app.messageforums.MessageForumsMessageManager;
031:
032:        /**
033:         * @author <a href="mailto:rshastri@iupui.edu">Rashmi Shastri</a>
034:         * @author Chen Wen
035:         *
036:         */
037:        public class DiscussionMessageBean {
038:            private boolean selected;
039:            private Message message;
040:            private boolean read;
041:            private int depth;
042:            private boolean hasNext;
043:            private boolean hasPre;
044:            private boolean hasChild;
045:            private int childUnread;
046:            private int childCount;
047:            private boolean hasNextThread;
048:            private boolean hasPreThread;
049:            private long nextThreadId;
050:            private long preThreadId;
051:            private String parentTopicTitle;
052:            private String parentForumTitle;
053:            private boolean revise;
054:
055:            private MessageForumsMessageManager messageManager;
056:
057:            public DiscussionMessageBean(Message msg,
058:                    MessageForumsMessageManager messageManager) {
059:                this .message = msg;
060:                this .messageManager = messageManager;
061:            }
062:
063:            /**
064:             * @return Returns the selected.
065:             */
066:            public boolean isSelected() {
067:                return selected;
068:            }
069:
070:            /**
071:             * @param selected The selected to set.
072:             */
073:            public void setSelected(boolean selected) {
074:                this .selected = selected;
075:            }
076:
077:            /**
078:             * @return Returns the msg.
079:             */
080:            public Message getMessage() {
081:                return message;
082:            }
083:
084:            /**
085:             * @return Returns the hasAttachment.
086:             */
087:            public boolean isHasAttachment() {
088:                if (message == null) {
089:                    return false;
090:                }
091:                message = messageManager.getMessageByIdWithAttachments(message
092:                        .getId());
093:                if (message.getAttachments() == null) {
094:                    return false;
095:                } else if (message.getAttachments().size() > 0) {
096:                    return true;
097:                }
098:                /*    else (changed after not lazy loading attachments.)
099:                 {
100:                 MessageForumsMessageManager mfmm = 
101:                 (org.sakaiproject.api.app.messageforums.MessageForumsMessageManager)ComponentManager.get("org.sakaiproject.api.app.messageforums.MessageForumsMessageManager");
102:                 Message messageWithAttach = mfmm.getMessageByIdWithAttachments(message.getId());
103:                 if(messageWithAttach != null)
104:                 {
105:                 if(messageWithAttach.getAttachments().size()>0)
106:                 return true;
107:                 }
108:                 }*/
109:                return false;
110:            }
111:
112:            /**
113:             * @return Returns the read.
114:             */
115:            public boolean isRead() {
116:                return read;
117:            }
118:
119:            /**
120:             * @param read The read to set.
121:             */
122:            public void setRead(boolean read) {
123:                this .read = read;
124:            }
125:
126:            public void setDepth(int depth) {
127:                this .depth = depth;
128:            }
129:
130:            public int getDepth() {
131:                return depth;
132:            }
133:
134:            /**
135:             * @return Returns the hasNext.
136:             */
137:            public boolean getHasNext() {
138:                return hasNext;
139:            }
140:
141:            /**
142:             * @param hasNext The hasNext to set.
143:             */
144:            public void setHasNext(boolean hasNext) {
145:                this .hasNext = hasNext;
146:            }
147:
148:            /**
149:             * @return Returns the hasPre.
150:             */
151:            public boolean getHasPre() {
152:                return hasPre;
153:            }
154:
155:            /**
156:             * @param hasPre The hasPre to set.
157:             */
158:            public void setHasPre(boolean hasPre) {
159:                this .hasPre = hasPre;
160:            }
161:
162:            public boolean getIsOwn() {
163:                if (this .getMessage().getCreatedBy().equals(
164:                        SessionManager.getCurrentSessionUserId()))
165:                    return true;
166:                return false;
167:            }
168:
169:            public void setHasChild(boolean hasChild) {
170:                this .hasChild = hasChild;
171:            }
172:
173:            public boolean getHasChild() {
174:                List childList = messageManager.getFirstLevelChildMsgs(this 
175:                        .getMessage().getId());
176:                if ((childList != null) && (childList.size() > 0))
177:                    hasChild = true;
178:                else
179:                    hasChild = false;
180:
181:                return hasChild;
182:            }
183:
184:            public ArrayList getAttachList() {
185:                ArrayList decoAttachList = new ArrayList();
186:                List attachList = message.getAttachments();
187:                if (attachList != null) {
188:                    for (int i = 0; i < attachList.size(); i++) {
189:                        DecoratedAttachment decoAttach = new DecoratedAttachment(
190:                                (Attachment) attachList.get(i));
191:                        decoAttachList.add(decoAttach);
192:                    }
193:                }
194:                return decoAttachList;
195:            }
196:
197:            public int getChildUnread() {
198:                return childUnread;
199:            }
200:
201:            public void setChildUnread(int newValue) {
202:                childUnread = newValue;
203:            }
204:
205:            public int getChildCount() {
206:                return childCount;
207:            }
208:
209:            public void setChildCount(int newValue) {
210:                childCount = newValue;
211:            }
212:
213:            public boolean getHasNextThread() {
214:                return hasNextThread;
215:            }
216:
217:            public void setHasNextThread(boolean newValue) {
218:                hasNextThread = newValue;
219:            }
220:
221:            public boolean getHasPreThread() {
222:                return hasPreThread;
223:            }
224:
225:            public void setHasPreThread(boolean newValue) {
226:                hasPreThread = newValue;
227:            }
228:
229:            public long getNextThreadId() {
230:                return nextThreadId;
231:            }
232:
233:            public void setNextThreadId(long newValue) {
234:                nextThreadId = newValue;
235:            }
236:
237:            public long getPreThreadId() {
238:                return preThreadId;
239:            }
240:
241:            public void setPreThreadId(long newValue) {
242:                preThreadId = newValue;
243:            }
244:
245:            /**
246:             * returns true if message has been approved
247:             * @return
248:             */
249:            public boolean isMsgApproved() {
250:                return message.getApproved() == Boolean.TRUE;
251:            }
252:
253:            /**
254:             * returns true if message has approval pending
255:             * @return
256:             */
257:            public boolean isMsgPending() {
258:                return message.getApproved() == null;
259:            }
260:
261:            /**
262:             * returns true if message was denied
263:             * @return
264:             */
265:            public boolean isMsgDenied() {
266:                return message.getApproved() == Boolean.FALSE;
267:            }
268:
269:            public void setRevise(boolean revise) {
270:                this .revise = revise;
271:            }
272:
273:            public boolean getRevise() {
274:                return this.revise;
275:            }
276:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.