KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MemberBean.java,v 1.17 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.17 $
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.Date JavaDoc;
44 import java.sql.Timestamp JavaDoc;
45 import java.util.Collection JavaDoc;
46 import java.util.Iterator JavaDoc;
47
48 import javax.servlet.http.HttpServletRequest JavaDoc;
49 import javax.servlet.http.HttpServletResponse JavaDoc;
50
51 import com.mvnforum.MVNForumGlobal;
52 import net.myvietnam.mvncore.security.Encoder;
53 import net.myvietnam.mvncore.service.BinaryStorage;
54 import net.myvietnam.mvncore.util.*;
55 import net.myvietnam.mvncore.web.URLResolverFactory;
56
57 /*
58  * Included columns: MemberID, MemberName, MemberFirstEmail, MemberEmail, MemberEmailVisible,
59  * MemberNameVisible, MemberFirstIP, MemberLastIP, MemberViewCount, MemberPostCount,
60  * MemberCreationDate, MemberModifiedDate, MemberLastLogon, MemberOption, MemberStatus,
61  * MemberActivateCode, MemberMessageCount, MemberMessageOption, MemberPostsPerPage, MemberWarnCount,
62  * MemberVoteCount, MemberVoteTotalStars, MemberRewardPoints, MemberTitle, MemberTimeZone,
63  * MemberSignature, MemberAvatar, MemberSkin, MemberLanguage, MemberFirstname,
64  * MemberLastname, MemberGender, MemberBirthday, MemberAddress, MemberCity,
65  * MemberState, MemberCountry, MemberPhone, MemberMobile, MemberFax,
66  * MemberCareer, MemberHomepage, MemberYahoo, MemberAol, MemberIcq,
67  * MemberMsn, MemberCoolLink1, MemberCoolLink2
68  * Excluded columns: MemberPassword, MemberTempPassword
69  */

70 public class MemberBean {
71     public static final int MEMBER_STATUS_ENABLE = 0;
72     public static final int MEMBER_STATUS_DISABLE = 1;
73
74     public static final int MEMBER_GENDER_FEMALE = 0;
75     public static final int MEMBER_GENDER_MALE = 1;
76     
77     public static final int MEMBER_EMAIL_INVISIBLE = 0;
78     public static final int MEMBER_EMAIL_VISIBLE = 1;
79
80     public static final int MEMBER_NAME_INVISIBLE = 0;
81     public static final int MEMBER_NAME_VISIBLE = 1;
82
83     public static final String JavaDoc MEMBER_ACTIVATECODE_ACTIVATED = "activated";
84
85     public static final String JavaDoc MEMBER_AVATAR_USING_UPLOAD = "uploaded";
86     
87     private int memberID;
88     private String JavaDoc memberName;
89     private String JavaDoc memberFirstEmail;
90     private String JavaDoc memberEmail;
91     private int memberEmailVisible;
92     private int memberNameVisible;
93     private String JavaDoc memberFirstIP;
94     private String JavaDoc memberLastIP;
95     private int memberViewCount;
96     private int memberPostCount;
97     private Timestamp JavaDoc memberCreationDate;
98     private Timestamp JavaDoc memberModifiedDate;
99     private Timestamp JavaDoc memberExpireDate;
100     private Timestamp JavaDoc memberLastLogon;
101     private int memberOption;
102     private int memberStatus;
103     private String JavaDoc memberActivateCode;
104     private int memberMessageCount;
105     private int memberMessageOption;
106     private int memberPostsPerPage;
107     private int memberWarnCount;
108     private int memberVoteCount;
109     private int memberVoteTotalStars;
110     private int memberRewardPoints;
111     private String JavaDoc memberTitle;
112     private double memberTimeZone;
113     private String JavaDoc memberSignature;
114     private String JavaDoc memberAvatar;
115     private String JavaDoc memberSkin;
116     private String JavaDoc memberLanguage;
117     private String JavaDoc memberFirstname;
118     private String JavaDoc memberLastname;
119     private int memberGender;
120     private Date JavaDoc memberBirthday;
121     private String JavaDoc memberAddress;
122     private String JavaDoc memberCity;
123     private String JavaDoc memberState;
124     private String JavaDoc memberCountry;
125     private String JavaDoc memberPhone;
126     private String JavaDoc memberMobile;
127     private String JavaDoc memberFax;
128     private String JavaDoc memberCareer;
129     private String JavaDoc memberHomepage;
130     private String JavaDoc memberYahoo;
131     private String JavaDoc memberAol;
132     private String JavaDoc memberIcq;
133     private String JavaDoc memberMsn;
134     private String JavaDoc memberCoolLink1;
135     private String JavaDoc memberCoolLink2;
136
137     public int getMemberID() {
138         return memberID;
139     }
140     public void setMemberID(int memberID) {
141         this.memberID = memberID;
142     }
143
144     public String JavaDoc getMemberName() {
145         return memberName;
146     }
147     public void setMemberName(String JavaDoc memberName) {
148         this.memberName = memberName;
149     }
150
151     public String JavaDoc getMemberFirstEmail() {
152         return memberFirstEmail;
153     }
154     public void setMemberFirstEmail(String JavaDoc memberFirstEmail) {
155         this.memberFirstEmail = StringUtil.getEmptyStringIfNull(memberFirstEmail);
156     }
157
158     public String JavaDoc getMemberEmail() {
159         return memberEmail;
160     }
161     public void setMemberEmail(String JavaDoc memberEmail) {
162         this.memberEmail = StringUtil.getEmptyStringIfNull(memberEmail);
163     }
164
165     public int getMemberEmailVisible() {
166         return memberEmailVisible;
167     }
168     public void setMemberEmailVisible(int memberEmailVisible) {
169         this.memberEmailVisible = memberEmailVisible;
170     }
171
172     public int getMemberNameVisible() {
173         return memberNameVisible;
174     }
175     public void setMemberNameVisible(int memberNameVisible) {
176         this.memberNameVisible = memberNameVisible;
177     }
178
179     public String JavaDoc getMemberFirstIP() {
180         return memberFirstIP;
181     }
182     public void setMemberFirstIP(String JavaDoc memberFirstIP) {
183         this.memberFirstIP = StringUtil.getEmptyStringIfNull(memberFirstIP);
184     }
185
186     public String JavaDoc getMemberLastIP() {
187         return memberLastIP;
188     }
189     public void setMemberLastIP(String JavaDoc memberLastIP) {
190         this.memberLastIP = StringUtil.getEmptyStringIfNull(memberLastIP);
191     }
192
193     public int getMemberViewCount() {
194         return memberViewCount;
195     }
196     public void setMemberViewCount(int memberViewCount) {
197         this.memberViewCount = memberViewCount;
198     }
199
200     public int getMemberPostCount() {
201         return memberPostCount;
202     }
203     public void setMemberPostCount(int memberPostCount) {
204         this.memberPostCount = memberPostCount;
205     }
206
207     public Timestamp JavaDoc getMemberCreationDate() {
208         return memberCreationDate;
209     }
210     public void setMemberCreationDate(Timestamp JavaDoc memberCreationDate) {
211         this.memberCreationDate = memberCreationDate;
212     }
213
214     public Timestamp JavaDoc getMemberModifiedDate() {
215         return memberModifiedDate;
216     }
217     public void setMemberModifiedDate(Timestamp JavaDoc memberModifiedDate) {
218         this.memberModifiedDate = memberModifiedDate;
219     }
220
221     public Timestamp JavaDoc getMemberExpireDate() {
222         return memberExpireDate;
223     }
224     public void setMemberExpireDate(Timestamp JavaDoc memberExpireDate) {
225         this.memberExpireDate = memberExpireDate;
226     }
227
228     public Timestamp JavaDoc getMemberLastLogon() {
229         return memberLastLogon;
230     }
231     public void setMemberLastLogon(Timestamp JavaDoc memberLastLogon) {
232         this.memberLastLogon = memberLastLogon;
233     }
234
235     public int getMemberOption() {
236         return memberOption;
237     }
238     public void setMemberOption(int memberOption) {
239         this.memberOption = memberOption;
240     }
241
242     public int getMemberStatus() {
243         return memberStatus;
244     }
245     public void setMemberStatus(int memberStatus) {
246         this.memberStatus = memberStatus;
247     }
248
249     public String JavaDoc getMemberActivateCode() {
250         return memberActivateCode;
251     }
252     public void setMemberActivateCode(String JavaDoc memberActivateCode) {
253         this.memberActivateCode = StringUtil.getEmptyStringIfNull(memberActivateCode);
254     }
255
256     public int getMemberMessageCount() {
257         return memberMessageCount;
258     }
259     public void setMemberMessageCount(int memberMessageCount) {
260         this.memberMessageCount = memberMessageCount;
261     }
262
263     public int getMemberMessageOption() {
264         return memberMessageOption;
265     }
266     public void setMemberMessageOption(int memberMessageOption) {
267         this.memberMessageOption = memberMessageOption;
268     }
269
270     public int getMemberPostsPerPage() {
271         return memberPostsPerPage;
272     }
273     public void setMemberPostsPerPage(int memberPostsPerPage) {
274         this.memberPostsPerPage = memberPostsPerPage;
275     }
276
277     public int getMemberWarnCount() {
278         return memberWarnCount;
279     }
280     public void setMemberWarnCount(int memberWarnCount) {
281         this.memberWarnCount = memberWarnCount;
282     }
283
284     public int getMemberVoteCount() {
285         return memberVoteCount;
286     }
287     public void setMemberVoteCount(int memberVoteCount) {
288         this.memberVoteCount = memberVoteCount;
289     }
290
291     public int getMemberVoteTotalStars() {
292         return memberVoteTotalStars;
293     }
294     public void setMemberVoteTotalStars(int memberVoteTotalStars) {
295         this.memberVoteTotalStars = memberVoteTotalStars;
296     }
297
298     public int getMemberRewardPoints() {
299         return memberRewardPoints;
300     }
301     public void setMemberRewardPoints(int memberRewardPoints) {
302         this.memberRewardPoints = memberRewardPoints;
303     }
304
305     public String JavaDoc getMemberTitle() {
306         return memberTitle;
307     }
308     public void setMemberTitle(String JavaDoc memberTitle) {
309         this.memberTitle = StringUtil.getEmptyStringIfNull(memberTitle);
310     }
311
312     public double getMemberTimeZone() {
313         return memberTimeZone;
314     }
315     public void setMemberTimeZone(double memberTimeZone) {
316         this.memberTimeZone = memberTimeZone;
317     }
318
319     public String JavaDoc getMemberSignature() {
320         return memberSignature;
321     }
322     public void setMemberSignature(String JavaDoc memberSignature) {
323         this.memberSignature = StringUtil.getEmptyStringIfNull(memberSignature);
324     }
325
326     public String JavaDoc getMemberAvatar() {
327         return memberAvatar;
328     }
329     public void setMemberAvatar(String JavaDoc memberAvatar) {
330         this.memberAvatar = StringUtil.getEmptyStringIfNull(memberAvatar);
331     }
332
333     public String JavaDoc getMemberSkin() {
334         return memberSkin;
335     }
336     public void setMemberSkin(String JavaDoc memberSkin) {
337         this.memberSkin = StringUtil.getEmptyStringIfNull(memberSkin);
338     }
339
340     public String JavaDoc getMemberLanguage() {
341         return memberLanguage;
342     }
343     public void setMemberLanguage(String JavaDoc memberLanguage) {
344         this.memberLanguage = StringUtil.getEmptyStringIfNull(memberLanguage);
345     }
346
347     public String JavaDoc getMemberFirstname() {
348         return memberFirstname;
349     }
350     public void setMemberFirstname(String JavaDoc memberFirstname) {
351         this.memberFirstname = StringUtil.getEmptyStringIfNull(memberFirstname);
352     }
353
354     public String JavaDoc getMemberLastname() {
355         return memberLastname;
356     }
357     public void setMemberLastname(String JavaDoc memberLastname) {
358         this.memberLastname = StringUtil.getEmptyStringIfNull(memberLastname);
359     }
360
361     public int getMemberGender() {
362         return memberGender;
363     }
364     public void setMemberGender(int memberGender) {
365         this.memberGender = memberGender;
366     }
367
368     public Date JavaDoc getMemberBirthday() {
369         return memberBirthday;
370     }
371     public void setMemberBirthday(Date JavaDoc memberBirthday) {
372         this.memberBirthday = memberBirthday;
373     }
374
375     public String JavaDoc getMemberAddress() {
376         return memberAddress;
377     }
378     public void setMemberAddress(String JavaDoc memberAddress) {
379         this.memberAddress = StringUtil.getEmptyStringIfNull(memberAddress);
380     }
381
382     public String JavaDoc getMemberCity() {
383         return memberCity;
384     }
385     public void setMemberCity(String JavaDoc memberCity) {
386         this.memberCity = StringUtil.getEmptyStringIfNull(memberCity);
387     }
388
389     public String JavaDoc getMemberState() {
390         return memberState;
391     }
392     public void setMemberState(String JavaDoc memberState) {
393         this.memberState = StringUtil.getEmptyStringIfNull(memberState);
394     }
395
396     public String JavaDoc getMemberCountry() {
397         return memberCountry;
398     }
399     public void setMemberCountry(String JavaDoc memberCountry) {
400         this.memberCountry = StringUtil.getEmptyStringIfNull(memberCountry);
401     }
402
403     public String JavaDoc getMemberPhone() {
404         return memberPhone;
405     }
406     public void setMemberPhone(String JavaDoc memberPhone) {
407         this.memberPhone = StringUtil.getEmptyStringIfNull(memberPhone);
408     }
409
410     public String JavaDoc getMemberMobile() {
411         return memberMobile;
412     }
413     public void setMemberMobile(String JavaDoc memberMobile) {
414         this.memberMobile = StringUtil.getEmptyStringIfNull(memberMobile);
415     }
416
417     public String JavaDoc getMemberFax() {
418         return memberFax;
419     }
420     public void setMemberFax(String JavaDoc memberFax) {
421         this.memberFax = StringUtil.getEmptyStringIfNull(memberFax);
422     }
423
424     public String JavaDoc getMemberCareer() {
425         return memberCareer;
426     }
427     public void setMemberCareer(String JavaDoc memberCareer) {
428         this.memberCareer = StringUtil.getEmptyStringIfNull(memberCareer);
429     }
430
431     public String JavaDoc getMemberHomepage() {
432         return memberHomepage;
433     }
434     public void setMemberHomepage(String JavaDoc memberHomepage) {
435         this.memberHomepage = StringUtil.getEmptyStringIfNull(memberHomepage);
436     }
437
438     public String JavaDoc getMemberYahoo() {
439         return memberYahoo;
440     }
441     public void setMemberYahoo(String JavaDoc memberYahoo) {
442         this.memberYahoo = StringUtil.getEmptyStringIfNull(memberYahoo);
443     }
444
445     public String JavaDoc getMemberAol() {
446         return memberAol;
447     }
448     public void setMemberAol(String JavaDoc memberAol) {
449         this.memberAol = StringUtil.getEmptyStringIfNull(memberAol);
450     }
451
452     public String JavaDoc getMemberIcq() {
453         return memberIcq;
454     }
455     public void setMemberIcq(String JavaDoc memberIcq) {
456         this.memberIcq = StringUtil.getEmptyStringIfNull(memberIcq);
457     }
458
459     public String JavaDoc getMemberMsn() {
460         return memberMsn;
461     }
462     public void setMemberMsn(String JavaDoc memberMsn) {
463         this.memberMsn = StringUtil.getEmptyStringIfNull(memberMsn);
464     }
465
466     public String JavaDoc getMemberCoolLink1() {
467         return memberCoolLink1;
468     }
469     public void setMemberCoolLink1(String JavaDoc memberCoolLink1) {
470         this.memberCoolLink1 = StringUtil.getEmptyStringIfNull(memberCoolLink1);
471     }
472
473     public String JavaDoc getMemberCoolLink2() {
474         return memberCoolLink2;
475     }
476     public void setMemberCoolLink2(String JavaDoc memberCoolLink2) {
477         this.memberCoolLink2 = StringUtil.getEmptyStringIfNull(memberCoolLink2);
478     }
479
480     public String JavaDoc getXML() {
481         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
482         xml.append("<MemberSection>\n");
483         xml.append(" <Rows>\n");
484         xml.append(" <Row>\n");
485         xml.append(" <Column>\n");
486         xml.append(" <Name>MemberID</Name>\n");
487         xml.append(" <Value>").append(String.valueOf(memberID)).append("</Value>\n");
488         xml.append(" </Column>\n");
489         xml.append(" <Column>\n");
490         xml.append(" <Name>MemberName</Name>\n");
491         xml.append(" <Value>").append(String.valueOf(memberName)).append("</Value>\n");
492         xml.append(" </Column>\n");
493         xml.append(" <Column>\n");
494         xml.append(" <Name>MemberFirstEmail</Name>\n");
495         xml.append(" <Value>").append(String.valueOf(memberFirstEmail)).append("</Value>\n");
496         xml.append(" </Column>\n");
497         xml.append(" <Column>\n");
498         xml.append(" <Name>MemberEmail</Name>\n");
499         xml.append(" <Value>").append(String.valueOf(memberEmail)).append("</Value>\n");
500         xml.append(" </Column>\n");
501         xml.append(" <Column>\n");
502         xml.append(" <Name>MemberEmailVisible</Name>\n");
503         xml.append(" <Value>").append(String.valueOf(memberEmailVisible)).append("</Value>\n");
504         xml.append(" </Column>\n");
505         xml.append(" <Column>\n");
506         xml.append(" <Name>MemberNameVisible</Name>\n");
507         xml.append(" <Value>").append(String.valueOf(memberNameVisible)).append("</Value>\n");
508         xml.append(" </Column>\n");
509         xml.append(" <Column>\n");
510         xml.append(" <Name>MemberFirstIP</Name>\n");
511         xml.append(" <Value>").append(String.valueOf(memberFirstIP)).append("</Value>\n");
512         xml.append(" </Column>\n");
513         xml.append(" <Column>\n");
514         xml.append(" <Name>MemberLastIP</Name>\n");
515         xml.append(" <Value>").append(String.valueOf(memberLastIP)).append("</Value>\n");
516         xml.append(" </Column>\n");
517         xml.append(" <Column>\n");
518         xml.append(" <Name>MemberViewCount</Name>\n");
519         xml.append(" <Value>").append(String.valueOf(memberViewCount)).append("</Value>\n");
520         xml.append(" </Column>\n");
521         xml.append(" <Column>\n");
522         xml.append(" <Name>MemberPostCount</Name>\n");
523         xml.append(" <Value>").append(String.valueOf(memberPostCount)).append("</Value>\n");
524         xml.append(" </Column>\n");
525         xml.append(" <Column>\n");
526         xml.append(" <Name>MemberCreationDate</Name>\n");
527         xml.append(" <Value>").append(String.valueOf(memberCreationDate)).append("</Value>\n");
528         xml.append(" </Column>\n");
529         xml.append(" <Column>\n");
530         xml.append(" <Name>MemberModifiedDate</Name>\n");
531         xml.append(" <Value>").append(String.valueOf(memberModifiedDate)).append("</Value>\n");
532         xml.append(" </Column>\n");
533         xml.append(" <Column>\n");
534         xml.append(" <Name>MemberExpireDate</Name>\n");
535         xml.append(" <Value>").append(String.valueOf(memberExpireDate)).append("</Value>\n");
536         xml.append(" </Column>\n");
537         xml.append(" <Column>\n");
538         xml.append(" <Name>MemberLastLogon</Name>\n");
539         xml.append(" <Value>").append(String.valueOf(memberLastLogon)).append("</Value>\n");
540         xml.append(" </Column>\n");
541         xml.append(" <Column>\n");
542         xml.append(" <Name>MemberOption</Name>\n");
543         xml.append(" <Value>").append(String.valueOf(memberOption)).append("</Value>\n");
544         xml.append(" </Column>\n");
545         xml.append(" <Column>\n");
546         xml.append(" <Name>MemberStatus</Name>\n");
547         xml.append(" <Value>").append(String.valueOf(memberStatus)).append("</Value>\n");
548         xml.append(" </Column>\n");
549         xml.append(" <Column>\n");
550         xml.append(" <Name>MemberActivateCode</Name>\n");
551         xml.append(" <Value>").append(String.valueOf(memberActivateCode)).append("</Value>\n");
552         xml.append(" </Column>\n");
553         xml.append(" <Column>\n");
554         xml.append(" <Name>MemberMessageCount</Name>\n");
555         xml.append(" <Value>").append(String.valueOf(memberMessageCount)).append("</Value>\n");
556         xml.append(" </Column>\n");
557         xml.append(" <Column>\n");
558         xml.append(" <Name>MemberMessageOption</Name>\n");
559         xml.append(" <Value>").append(String.valueOf(memberMessageOption)).append("</Value>\n");
560         xml.append(" </Column>\n");
561         xml.append(" <Column>\n");
562         xml.append(" <Name>MemberPostsPerPage</Name>\n");
563         xml.append(" <Value>").append(String.valueOf(memberPostsPerPage)).append("</Value>\n");
564         xml.append(" </Column>\n");
565         xml.append(" <Column>\n");
566         xml.append(" <Name>MemberWarnCount</Name>\n");
567         xml.append(" <Value>").append(String.valueOf(memberWarnCount)).append("</Value>\n");
568         xml.append(" </Column>\n");
569         xml.append(" <Column>\n");
570         xml.append(" <Name>MemberVoteCount</Name>\n");
571         xml.append(" <Value>").append(String.valueOf(memberVoteCount)).append("</Value>\n");
572         xml.append(" </Column>\n");
573         xml.append(" <Column>\n");
574         xml.append(" <Name>MemberVoteTotalStars</Name>\n");
575         xml.append(" <Value>").append(String.valueOf(memberVoteTotalStars)).append("</Value>\n");
576         xml.append(" </Column>\n");
577         xml.append(" <Column>\n");
578         xml.append(" <Name>MemberRewardPoints</Name>\n");
579         xml.append(" <Value>").append(String.valueOf(memberRewardPoints)).append("</Value>\n");
580         xml.append(" </Column>\n");
581         xml.append(" <Column>\n");
582         xml.append(" <Name>MemberTitle</Name>\n");
583         xml.append(" <Value>").append(String.valueOf(memberTitle)).append("</Value>\n");
584         xml.append(" </Column>\n");
585         xml.append(" <Column>\n");
586         xml.append(" <Name>MemberTimeZone</Name>\n");
587         xml.append(" <Value>").append(String.valueOf(memberTimeZone)).append("</Value>\n");
588         xml.append(" </Column>\n");
589         xml.append(" <Column>\n");
590         xml.append(" <Name>MemberSignature</Name>\n");
591         xml.append(" <Value>").append(String.valueOf(memberSignature)).append("</Value>\n");
592         xml.append(" </Column>\n");
593         xml.append(" <Column>\n");
594         xml.append(" <Name>MemberAvatar</Name>\n");
595         xml.append(" <Value>").append(String.valueOf(memberAvatar)).append("</Value>\n");
596         xml.append(" </Column>\n");
597         xml.append(" <Column>\n");
598         xml.append(" <Name>MemberSkin</Name>\n");
599         xml.append(" <Value>").append(String.valueOf(memberSkin)).append("</Value>\n");
600         xml.append(" </Column>\n");
601         xml.append(" <Column>\n");
602         xml.append(" <Name>MemberLanguage</Name>\n");
603         xml.append(" <Value>").append(String.valueOf(memberLanguage)).append("</Value>\n");
604         xml.append(" </Column>\n");
605         xml.append(" <Column>\n");
606         xml.append(" <Name>MemberFirstname</Name>\n");
607         xml.append(" <Value>").append(String.valueOf(memberFirstname)).append("</Value>\n");
608         xml.append(" </Column>\n");
609         xml.append(" <Column>\n");
610         xml.append(" <Name>MemberLastname</Name>\n");
611         xml.append(" <Value>").append(String.valueOf(memberLastname)).append("</Value>\n");
612         xml.append(" </Column>\n");
613         xml.append(" <Column>\n");
614         xml.append(" <Name>MemberGender</Name>\n");
615         xml.append(" <Value>").append(String.valueOf(memberGender)).append("</Value>\n");
616         xml.append(" </Column>\n");
617         xml.append(" <Column>\n");
618         xml.append(" <Name>MemberBirthday</Name>\n");
619         xml.append(" <Value>").append(String.valueOf(memberBirthday)).append("</Value>\n");
620         xml.append(" </Column>\n");
621         xml.append(" <Column>\n");
622         xml.append(" <Name>MemberAddress</Name>\n");
623         xml.append(" <Value>").append(String.valueOf(memberAddress)).append("</Value>\n");
624         xml.append(" </Column>\n");
625         xml.append(" <Column>\n");
626         xml.append(" <Name>MemberCity</Name>\n");
627         xml.append(" <Value>").append(String.valueOf(memberCity)).append("</Value>\n");
628         xml.append(" </Column>\n");
629         xml.append(" <Column>\n");
630         xml.append(" <Name>MemberState</Name>\n");
631         xml.append(" <Value>").append(String.valueOf(memberState)).append("</Value>\n");
632         xml.append(" </Column>\n");
633         xml.append(" <Column>\n");
634         xml.append(" <Name>MemberCountry</Name>\n");
635         xml.append(" <Value>").append(String.valueOf(memberCountry)).append("</Value>\n");
636         xml.append(" </Column>\n");
637         xml.append(" <Column>\n");
638         xml.append(" <Name>MemberPhone</Name>\n");
639         xml.append(" <Value>").append(String.valueOf(memberPhone)).append("</Value>\n");
640         xml.append(" </Column>\n");
641         xml.append(" <Column>\n");
642         xml.append(" <Name>MemberMobile</Name>\n");
643         xml.append(" <Value>").append(String.valueOf(memberMobile)).append("</Value>\n");
644         xml.append(" </Column>\n");
645         xml.append(" <Column>\n");
646         xml.append(" <Name>MemberFax</Name>\n");
647         xml.append(" <Value>").append(String.valueOf(memberFax)).append("</Value>\n");
648         xml.append(" </Column>\n");
649         xml.append(" <Column>\n");
650         xml.append(" <Name>MemberCareer</Name>\n");
651         xml.append(" <Value>").append(String.valueOf(memberCareer)).append("</Value>\n");
652         xml.append(" </Column>\n");
653         xml.append(" <Column>\n");
654         xml.append(" <Name>MemberHomepage</Name>\n");
655         xml.append(" <Value>").append(String.valueOf(memberHomepage)).append("</Value>\n");
656         xml.append(" </Column>\n");
657         xml.append(" <Column>\n");
658         xml.append(" <Name>MemberYahoo</Name>\n");
659         xml.append(" <Value>").append(String.valueOf(memberYahoo)).append("</Value>\n");
660         xml.append(" </Column>\n");
661         xml.append(" <Column>\n");
662         xml.append(" <Name>MemberAol</Name>\n");
663         xml.append(" <Value>").append(String.valueOf(memberAol)).append("</Value>\n");
664         xml.append(" </Column>\n");
665         xml.append(" <Column>\n");
666         xml.append(" <Name>MemberIcq</Name>\n");
667         xml.append(" <Value>").append(String.valueOf(memberIcq)).append("</Value>\n");
668         xml.append(" </Column>\n");
669         xml.append(" <Column>\n");
670         xml.append(" <Name>MemberMsn</Name>\n");
671         xml.append(" <Value>").append(String.valueOf(memberMsn)).append("</Value>\n");
672         xml.append(" </Column>\n");
673         xml.append(" <Column>\n");
674         xml.append(" <Name>MemberCoolLink1</Name>\n");
675         xml.append(" <Value>").append(String.valueOf(memberCoolLink1)).append("</Value>\n");
676         xml.append(" </Column>\n");
677         xml.append(" <Column>\n");
678         xml.append(" <Name>MemberCoolLink2</Name>\n");
679         xml.append(" <Value>").append(String.valueOf(memberCoolLink2)).append("</Value>\n");
680         xml.append(" </Column>\n");
681         xml.append(" </Row>\n");
682         xml.append(" </Rows>\n");
683         xml.append("</MemberSection>\n");
684         return xml.toString();
685     }
686
687     public static String JavaDoc getXML(Collection JavaDoc objMemberBeans) {
688         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
689         Iterator JavaDoc iterator = objMemberBeans.iterator();
690         xml.append("<MemberSection>\n");
691         xml.append(" <Rows>\n");
692         while (iterator.hasNext()) {
693             MemberBean objMemberBean = (MemberBean)iterator.next();
694             xml.append(" <Row>\n");
695             xml.append(" <Column>\n");
696             xml.append(" <Name>MemberID</Name>\n");
697             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberID)).append("</Value>\n");
698             xml.append(" </Column>\n");
699             xml.append(" <Column>\n");
700             xml.append(" <Name>MemberName</Name>\n");
701             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberName)).append("</Value>\n");
702             xml.append(" </Column>\n");
703             xml.append(" <Column>\n");
704             xml.append(" <Name>MemberFirstEmail</Name>\n");
705             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberFirstEmail)).append("</Value>\n");
706             xml.append(" </Column>\n");
707             xml.append(" <Column>\n");
708             xml.append(" <Name>MemberEmail</Name>\n");
709             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberEmail)).append("</Value>\n");
710             xml.append(" </Column>\n");
711             xml.append(" <Column>\n");
712             xml.append(" <Name>MemberEmailVisible</Name>\n");
713             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberEmailVisible)).append("</Value>\n");
714             xml.append(" </Column>\n");
715             xml.append(" <Column>\n");
716             xml.append(" <Name>MemberNameVisible</Name>\n");
717             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberNameVisible)).append("</Value>\n");
718             xml.append(" </Column>\n");
719             xml.append(" <Column>\n");
720             xml.append(" <Name>MemberFirstIP</Name>\n");
721             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberFirstIP)).append("</Value>\n");
722             xml.append(" </Column>\n");
723             xml.append(" <Column>\n");
724             xml.append(" <Name>MemberLastIP</Name>\n");
725             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberLastIP)).append("</Value>\n");
726             xml.append(" </Column>\n");
727             xml.append(" <Column>\n");
728             xml.append(" <Name>MemberViewCount</Name>\n");
729             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberViewCount)).append("</Value>\n");
730             xml.append(" </Column>\n");
731             xml.append(" <Column>\n");
732             xml.append(" <Name>MemberPostCount</Name>\n");
733             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberPostCount)).append("</Value>\n");
734             xml.append(" </Column>\n");
735             xml.append(" <Column>\n");
736             xml.append(" <Name>MemberCreationDate</Name>\n");
737             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCreationDate)).append("</Value>\n");
738             xml.append(" </Column>\n");
739             xml.append(" <Column>\n");
740             xml.append(" <Name>MemberModifiedDate</Name>\n");
741             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberModifiedDate)).append("</Value>\n");
742             xml.append(" </Column>\n");
743             xml.append(" <Column>\n");
744             xml.append(" <Name>MemberExpireDate</Name>\n");
745             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberExpireDate)).append("</Value>\n");
746             xml.append(" </Column>\n");
747             xml.append(" <Column>\n");
748             xml.append(" <Name>MemberLastLogon</Name>\n");
749             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberLastLogon)).append("</Value>\n");
750             xml.append(" </Column>\n");
751             xml.append(" <Column>\n");
752             xml.append(" <Name>MemberOption</Name>\n");
753             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberOption)).append("</Value>\n");
754             xml.append(" </Column>\n");
755             xml.append(" <Column>\n");
756             xml.append(" <Name>MemberStatus</Name>\n");
757             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberStatus)).append("</Value>\n");
758             xml.append(" </Column>\n");
759             xml.append(" <Column>\n");
760             xml.append(" <Name>MemberActivateCode</Name>\n");
761             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberActivateCode)).append("</Value>\n");
762             xml.append(" </Column>\n");
763             xml.append(" <Column>\n");
764             xml.append(" <Name>MemberMessageCount</Name>\n");
765             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberMessageCount)).append("</Value>\n");
766             xml.append(" </Column>\n");
767             xml.append(" <Column>\n");
768             xml.append(" <Name>MemberMessageOption</Name>\n");
769             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberMessageOption)).append("</Value>\n");
770             xml.append(" </Column>\n");
771             xml.append(" <Column>\n");
772             xml.append(" <Name>MemberPostsPerPage</Name>\n");
773             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberPostsPerPage)).append("</Value>\n");
774             xml.append(" </Column>\n");
775             xml.append(" <Column>\n");
776             xml.append(" <Name>MemberWarnCount</Name>\n");
777             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberWarnCount)).append("</Value>\n");
778             xml.append(" </Column>\n");
779             xml.append(" <Column>\n");
780             xml.append(" <Name>MemberVoteCount</Name>\n");
781             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberVoteCount)).append("</Value>\n");
782             xml.append(" </Column>\n");
783             xml.append(" <Column>\n");
784             xml.append(" <Name>MemberVoteTotalStars</Name>\n");
785             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberVoteTotalStars)).append("</Value>\n");
786             xml.append(" </Column>\n");
787             xml.append(" <Column>\n");
788             xml.append(" <Name>MemberRewardPoints</Name>\n");
789             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberRewardPoints)).append("</Value>\n");
790             xml.append(" </Column>\n");
791             xml.append(" <Column>\n");
792             xml.append(" <Name>MemberTitle</Name>\n");
793             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberTitle)).append("</Value>\n");
794             xml.append(" </Column>\n");
795             xml.append(" <Column>\n");
796             xml.append(" <Name>MemberTimeZone</Name>\n");
797             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberTimeZone)).append("</Value>\n");
798             xml.append(" </Column>\n");
799             xml.append(" <Column>\n");
800             xml.append(" <Name>MemberSignature</Name>\n");
801             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberSignature)).append("</Value>\n");
802             xml.append(" </Column>\n");
803             xml.append(" <Column>\n");
804             xml.append(" <Name>MemberAvatar</Name>\n");
805             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberAvatar)).append("</Value>\n");
806             xml.append(" </Column>\n");
807             xml.append(" <Column>\n");
808             xml.append(" <Name>MemberSkin</Name>\n");
809             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberSkin)).append("</Value>\n");
810             xml.append(" </Column>\n");
811             xml.append(" <Column>\n");
812             xml.append(" <Name>MemberLanguage</Name>\n");
813             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberLanguage)).append("</Value>\n");
814             xml.append(" </Column>\n");
815             xml.append(" <Column>\n");
816             xml.append(" <Name>MemberFirstname</Name>\n");
817             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberFirstname)).append("</Value>\n");
818             xml.append(" </Column>\n");
819             xml.append(" <Column>\n");
820             xml.append(" <Name>MemberLastname</Name>\n");
821             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberLastname)).append("</Value>\n");
822             xml.append(" </Column>\n");
823             xml.append(" <Column>\n");
824             xml.append(" <Name>MemberGender</Name>\n");
825             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberGender)).append("</Value>\n");
826             xml.append(" </Column>\n");
827             xml.append(" <Column>\n");
828             xml.append(" <Name>MemberBirthday</Name>\n");
829             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberBirthday)).append("</Value>\n");
830             xml.append(" </Column>\n");
831             xml.append(" <Column>\n");
832             xml.append(" <Name>MemberAddress</Name>\n");
833             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberAddress)).append("</Value>\n");
834             xml.append(" </Column>\n");
835             xml.append(" <Column>\n");
836             xml.append(" <Name>MemberCity</Name>\n");
837             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCity)).append("</Value>\n");
838             xml.append(" </Column>\n");
839             xml.append(" <Column>\n");
840             xml.append(" <Name>MemberState</Name>\n");
841             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberState)).append("</Value>\n");
842             xml.append(" </Column>\n");
843             xml.append(" <Column>\n");
844             xml.append(" <Name>MemberCountry</Name>\n");
845             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCountry)).append("</Value>\n");
846             xml.append(" </Column>\n");
847             xml.append(" <Column>\n");
848             xml.append(" <Name>MemberPhone</Name>\n");
849             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberPhone)).append("</Value>\n");
850             xml.append(" </Column>\n");
851             xml.append(" <Column>\n");
852             xml.append(" <Name>MemberMobile</Name>\n");
853             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberMobile)).append("</Value>\n");
854             xml.append(" </Column>\n");
855             xml.append(" <Column>\n");
856             xml.append(" <Name>MemberFax</Name>\n");
857             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberFax)).append("</Value>\n");
858             xml.append(" </Column>\n");
859             xml.append(" <Column>\n");
860             xml.append(" <Name>MemberCareer</Name>\n");
861             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCareer)).append("</Value>\n");
862             xml.append(" </Column>\n");
863             xml.append(" <Column>\n");
864             xml.append(" <Name>MemberHomepage</Name>\n");
865             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberHomepage)).append("</Value>\n");
866             xml.append(" </Column>\n");
867             xml.append(" <Column>\n");
868             xml.append(" <Name>MemberYahoo</Name>\n");
869             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberYahoo)).append("</Value>\n");
870             xml.append(" </Column>\n");
871             xml.append(" <Column>\n");
872             xml.append(" <Name>MemberAol</Name>\n");
873             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberAol)).append("</Value>\n");
874             xml.append(" </Column>\n");
875             xml.append(" <Column>\n");
876             xml.append(" <Name>MemberIcq</Name>\n");
877             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberIcq)).append("</Value>\n");
878             xml.append(" </Column>\n");
879             xml.append(" <Column>\n");
880             xml.append(" <Name>MemberMsn</Name>\n");
881             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberMsn)).append("</Value>\n");
882             xml.append(" </Column>\n");
883             xml.append(" <Column>\n");
884             xml.append(" <Name>MemberCoolLink1</Name>\n");
885             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCoolLink1)).append("</Value>\n");
886             xml.append(" </Column>\n");
887             xml.append(" <Column>\n");
888             xml.append(" <Name>MemberCoolLink2</Name>\n");
889             xml.append(" <Value>").append(String.valueOf(objMemberBean.memberCoolLink2)).append("</Value>\n");
890             xml.append(" </Column>\n");
891             xml.append(" </Row>\n");
892         }//while
893
xml.append(" </Rows>\n");
894         xml.append("</MemberSection>\n");
895         return xml.toString();
896     }
897
898     /////////////////////////////////////////////////////////////////
899
// utility methods
900
/*
901      * @todo : review these methods
902      */

903     public String JavaDoc getMemberGenderString() {
904         if (memberGender == 1) return "Male";
905         return "Female";
906     }
907
908     public String JavaDoc getMemberAvatar_processed(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
909         if (memberAvatar.length() == 0) {// never null here, see setMemberAvatar
910
return "";
911         }
912         String JavaDoc retMemberAvatar = memberAvatar;
913         if (retMemberAvatar.equals(MemberBean.MEMBER_AVATAR_USING_UPLOAD) ||
914             retMemberAvatar.startsWith(BinaryStorage.BINARY_STORAGE)||
915             retMemberAvatar.startsWith(MVNForumGlobal.UPLOADED_AVATAR_DIR)) {
916             //relative path
917
retMemberAvatar = "getavatar?memberid=" + memberID;
918             retMemberAvatar = URLResolverFactory.getURLResolver().encodeURL(request, response, retMemberAvatar);
919         } else {
920             // this mean use mvnForum's default avatar
921
if (memberAvatar.startsWith("/mvnplugin")) {
922                 // no context prefix, so we prepend the contextPath
923
retMemberAvatar = ParamUtil.getContextPath() + memberAvatar;
924             }
925         }
926         return retMemberAvatar;
927     }
928
929     public String JavaDoc getMemberHomepage_http() {
930         if (memberHomepage == null) memberHomepage = "";
931         return Encoder.filterUrl(memberHomepage);
932         /*
933         String ret = memberHomepage.toLowerCase();
934         if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
935             ret = "http://" + ret;
936         }
937         return ret;
938         */

939     }
940
941     public String JavaDoc getMemberCoolLink1_http() {
942         if (memberCoolLink1 == null) memberCoolLink1 = "";
943         return Encoder.filterUrl(memberCoolLink1);
944         /*
945         String ret = memberCoolLink1.toLowerCase();
946         if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
947             ret = "http://" + ret;
948         }
949         return ret;
950         */

951     }
952
953     public String JavaDoc getMemberCoolLink2_http() {
954         if (memberCoolLink2 == null) memberCoolLink2 = "";
955         return Encoder.filterUrl(memberCoolLink2);
956         /*
957         String ret = memberCoolLink2.toLowerCase();
958         if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
959             ret = "http://" + ret;
960         }
961         return ret;
962         */

963     }
964
965     public String JavaDoc getMemberCreationDate_short() {
966         return DateUtil.getDateDDMMYYYY(memberCreationDate);
967     }
968
969     public String JavaDoc getMemberExpireDate_short() {
970         return DateUtil.getDateDDMMYYYY(memberExpireDate);
971     }
972
973     public boolean isInvisible() {
974         return (this.memberNameVisible == MEMBER_NAME_INVISIBLE);
975     }
976
977     public boolean showEmail() {
978         return (this.memberEmailVisible == MEMBER_EMAIL_VISIBLE);
979     }
980
981     public void init() {
982         //setMemberID(resultSet.getInt("MemberID"));
983
Timestamp JavaDoc now = DateUtil.getCurrentGMTTimestamp();
984         setMemberName("");
985         setMemberEmail("");
986         setMemberEmailVisible(MEMBER_EMAIL_INVISIBLE);
987         setMemberNameVisible(MEMBER_NAME_VISIBLE);
988         setMemberViewCount(0);
989         setMemberPostCount(0);
990         setMemberCreationDate(now);
991         setMemberLastLogon(now);
992         setMemberOption(0);
993         setMemberStatus(MEMBER_STATUS_ENABLE);
994         setMemberWarnCount(0);
995         setMemberVoteCount(0);
996         setMemberVoteTotalStars(0);
997         setMemberRewardPoints(0);
998         setMemberTitle("");
999         setMemberSignature("");
1000        setMemberAvatar("");
1001        setMemberFirstname("");
1002        setMemberLastname("");
1003        setMemberGender(MEMBER_GENDER_MALE);
1004        setMemberBirthday(new java.sql.Date JavaDoc(0));
1005        setMemberAddress("");
1006        setMemberCity("");
1007        setMemberState("");
1008        setMemberCountry("");
1009        setMemberPhone("");
1010        setMemberMobile("");
1011        setMemberFax("");
1012        setMemberCareer("");
1013        setMemberHomepage("");
1014        setMemberYahoo("");
1015        setMemberAol("");
1016        setMemberIcq("");
1017        setMemberMsn("");
1018        setMemberCoolLink1("");
1019        setMemberCoolLink2("");
1020        setMemberActivateCode("");
1021        
1022    }
1023} //end of class MemberBean
1024

1025
1026
Popular Tags