KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > MessageFolderBean


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageFolderBean.java,v 1.10 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.10 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  * @author: Mai Nguyen
40  */

41 package com.mvnforum.db;
42
43 import java.sql.Timestamp JavaDoc;
44 import java.util.Collection JavaDoc;//for xml support
45
import java.util.Iterator JavaDoc;//for xml support
46

47 /*
48  * Included columns: FolderName, MemberID, FolderOrder, FolderStatus, FolderOption,
49  * FolderType, FolderCreationDate, FolderModifiedDate
50  * Excluded columns:
51  */

52 public class MessageFolderBean {
53     private String JavaDoc folderName;
54     private int memberID;
55     private int folderOrder;
56     private int folderStatus;
57     private int folderOption;
58     private int folderType;
59     private Timestamp JavaDoc folderCreationDate;
60     private Timestamp JavaDoc folderModifiedDate;
61
62     public String JavaDoc getFolderName() {
63         return folderName;
64     }
65     public void setFolderName(String JavaDoc folderName) {
66         this.folderName = folderName;
67     }
68
69     public int getMemberID() {
70         return memberID;
71     }
72     public void setMemberID(int memberID) {
73         this.memberID = memberID;
74     }
75
76     public int getFolderOrder() {
77         return folderOrder;
78     }
79     public void setFolderOrder(int folderOrder) {
80         this.folderOrder = folderOrder;
81     }
82
83     public int getFolderStatus() {
84         return folderStatus;
85     }
86     public void setFolderStatus(int folderStatus) {
87         this.folderStatus = folderStatus;
88     }
89
90     public int getFolderOption() {
91         return folderOption;
92     }
93     public void setFolderOption(int folderOption) {
94         this.folderOption = folderOption;
95     }
96
97     public int getFolderType() {
98         return folderType;
99     }
100     public void setFolderType(int folderType) {
101         this.folderType = folderType;
102     }
103
104     public Timestamp JavaDoc getFolderCreationDate() {
105         return folderCreationDate;
106     }
107     public void setFolderCreationDate(Timestamp JavaDoc folderCreationDate) {
108         this.folderCreationDate = folderCreationDate;
109     }
110
111     public Timestamp JavaDoc getFolderModifiedDate() {
112         return folderModifiedDate;
113     }
114     public void setFolderModifiedDate(Timestamp JavaDoc folderModifiedDate) {
115         this.folderModifiedDate = folderModifiedDate;
116     }
117
118     public String JavaDoc getXML() {
119         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
120         xml.append("<MessageFolderSection>\n");
121         xml.append(" <Rows>\n");
122         xml.append(" <Row>\n");
123         xml.append(" <Column>\n");
124         xml.append(" <Name>FolderName</Name>\n");
125         xml.append(" <Value>").append(String.valueOf(folderName)).append("</Value>\n");
126         xml.append(" </Column>\n");
127         xml.append(" <Column>\n");
128         xml.append(" <Name>MemberID</Name>\n");
129         xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n");
130         xml.append(" </Column>\n");
131         xml.append(" <Column>\n");
132         xml.append(" <Name>FolderOrder</Name>\n");
133         xml.append(" <Value>").append(String.valueOf(folderOrder)).append("</Value>\n");
134         xml.append(" </Column>\n");
135         xml.append(" <Column>\n");
136         xml.append(" <Name>FolderStatus</Name>\n");
137         xml.append(" <Value>").append(String.valueOf(folderStatus)).append("</Value>\n");
138         xml.append(" </Column>\n");
139         xml.append(" <Column>\n");
140         xml.append(" <Name>FolderOption</Name>\n");
141         xml.append(" <Value>").append(String.valueOf(folderOption)).append("</Value>\n");
142         xml.append(" </Column>\n");
143         xml.append(" <Column>\n");
144         xml.append(" <Name>FolderType</Name>\n");
145         xml.append(" <Value>").append(String.valueOf(folderType)).append("</Value>\n");
146         xml.append(" </Column>\n");
147         xml.append(" <Column>\n");
148         xml.append(" <Name>FolderCreationDate</Name>\n");
149         xml.append(" <Value>").append(String.valueOf(folderCreationDate)).append("</Value>\n");
150         xml.append(" </Column>\n");
151         xml.append(" <Column>\n");
152         xml.append(" <Name>FolderModifiedDate</Name>\n");
153         xml.append(" <Value>").append(String.valueOf(folderModifiedDate)).append("</Value>\n");
154         xml.append(" </Column>\n");
155         xml.append(" </Row>\n");
156         xml.append(" </Rows>\n");
157         xml.append("</MessageFolderSection>\n");
158         return xml.toString();
159     }
160
161     public static String JavaDoc getXML(Collection JavaDoc objMessageFolderBeans) {
162         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
163         Iterator JavaDoc iterator = objMessageFolderBeans.iterator();
164         xml.append("<MessageFolderSection>\n");
165         xml.append(" <Rows>\n");
166         while (iterator.hasNext()) {
167             MessageFolderBean objMessageFolderBean = (MessageFolderBean)iterator.next();
168             xml.append(" <Row>\n");
169             xml.append(" <Column>\n");
170             xml.append(" <Name>FolderName</Name>\n");
171             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderName)).append("</Value>\n");
172             xml.append(" </Column>\n");
173             xml.append(" <Column>\n");
174             xml.append(" <Name>MemberID</Name>\n");
175             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.memberID)).append("</Value>\n");
176             xml.append(" </Column>\n");
177             xml.append(" <Column>\n");
178             xml.append(" <Name>FolderOrder</Name>\n");
179             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderOrder)).append("</Value>\n");
180             xml.append(" </Column>\n");
181             xml.append(" <Column>\n");
182             xml.append(" <Name>FolderStatus</Name>\n");
183             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderStatus)).append("</Value>\n");
184             xml.append(" </Column>\n");
185             xml.append(" <Column>\n");
186             xml.append(" <Name>FolderOption</Name>\n");
187             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderOption)).append("</Value>\n");
188             xml.append(" </Column>\n");
189             xml.append(" <Column>\n");
190             xml.append(" <Name>FolderType</Name>\n");
191             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderType)).append("</Value>\n");
192             xml.append(" </Column>\n");
193             xml.append(" <Column>\n");
194             xml.append(" <Name>FolderCreationDate</Name>\n");
195             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderCreationDate)).append("</Value>\n");
196             xml.append(" </Column>\n");
197             xml.append(" <Column>\n");
198             xml.append(" <Name>FolderModifiedDate</Name>\n");
199             xml.append(" <Value>").append(String.valueOf(objMessageFolderBean.folderModifiedDate)).append("</Value>\n");
200             xml.append(" </Column>\n");
201             xml.append(" </Row>\n");
202         }//while
203
xml.append(" </Rows>\n");
204         xml.append("</MessageFolderSection>\n");
205         return xml.toString();
206     }
207
208     /************************************************
209      * Customized methods come below
210      ************************************************/

211     private int messageCount;
212     private int unreadMessageCount;
213
214     public int getMessageCount() {
215         return messageCount;
216     }
217
218     public void setMessageCount(int messageCount) {
219         this.messageCount = messageCount;
220     }
221
222     public int getUnreadMessageCount() {
223         return this.unreadMessageCount;
224     }
225
226     public void setUnreadMessageCount(int unreadMessageCount) {
227         this.unreadMessageCount = unreadMessageCount;
228     }
229
230 } //end of class MessageFolderBean
231
Popular Tags