home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MemberBean.java,v 1.11 2005/01/27 14:34:27 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.11 $
 * $Date: 2005/01/27 14:34:27 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 */
package com.mvnforum.db;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Iterator;

import com.mvnforum.MVNForumGlobal;
import net.myvietnam.mvncore.security.Encoder;
import net.myvietnam.mvncore.util.*;

/*
 * Included columns: MemberID, MemberName, MemberFirstEmail, MemberEmail, MemberEmailVisible,
 *                   MemberNameVisible, MemberFirstIP, MemberLastIP, MemberViewCount, MemberPostCount,
 *                   MemberCreationDate, MemberModifiedDate, MemberLastLogon, MemberOption, MemberStatus,
 *                   MemberActivateCode, MemberMessageCount, MemberMessageOption, MemberPostsPerPage, MemberWarnCount,
 *                   MemberVoteCount, MemberVoteTotalStars, MemberRewardPoints, MemberTitle, MemberTimeZone,
 *                   MemberSignature, MemberAvatar, MemberSkin, MemberLanguage, MemberFirstname,
 *                   MemberLastname, MemberGender, MemberBirthday, MemberAddress, MemberCity,
 *                   MemberState, MemberCountry, MemberPhone, MemberMobile, MemberFax,
 *                   MemberCareer, MemberHomepage, MemberYahoo, MemberAol, MemberIcq,
 *                   MemberMsn, MemberCoolLink1, MemberCoolLink2
 * Excluded columns: MemberPassword, MemberTempPassword
 */
public class MemberBean {
    public static final int MEMBER_STATUS_ENABLE    = 0;
    public static final int MEMBER_STATUS_DISABLE   = 1;

    public static final int MEMBER_EMAIL_INVISIBLE  = 0;
    public static final int MEMBER_EMAIL_VISIBLE    = 1;

    public static final int MEMBER_NAME_INVISIBLE   = 0;
    public static final int MEMBER_NAME_VISIBLE     = 1;

    public static final String MEMBER_ACTIVATECODE_ACTIVATED = "activated";

    public static final String MEMBER_AVATAR_USING_UPLOAD = "uploaded";

    private int memberID;
    private String memberName;
    private String memberFirstEmail;
    private String memberEmail;
    private int memberEmailVisible;
    private int memberNameVisible;
    private String memberFirstIP;
    private String memberLastIP;
    private int memberViewCount;
    private int memberPostCount;
    private Timestamp memberCreationDate;
    private Timestamp memberModifiedDate;
    private Timestamp memberExpireDate;
    private Timestamp memberLastLogon;
    private int memberOption;
    private int memberStatus;
    private String memberActivateCode;
    private int memberMessageCount;
    private int memberMessageOption;
    private int memberPostsPerPage;
    private int memberWarnCount;
    private int memberVoteCount;
    private int memberVoteTotalStars;
    private int memberRewardPoints;
    private String memberTitle;
    private int memberTimeZone;
    private String memberSignature;
    private String memberAvatar;
    private String memberSkin;
    private String memberLanguage;
    private String memberFirstname;
    private String memberLastname;
    private int memberGender;
    private Date memberBirthday;
    private String memberAddress;
    private String memberCity;
    private String memberState;
    private String memberCountry;
    private String memberPhone;
    private String memberMobile;
    private String memberFax;
    private String memberCareer;
    private String memberHomepage;
    private String memberYahoo;
    private String memberAol;
    private String memberIcq;
    private String memberMsn;
    private String memberCoolLink1;
    private String memberCoolLink2;

    public int getMemberID() {
        return memberID;
    }
    public void setMemberID(int memberID) {
        this.memberID = memberID;
    }

    public String getMemberName() {
        return memberName;
    }
    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberFirstEmail() {
        return memberFirstEmail;
    }
    public void setMemberFirstEmail(String memberFirstEmail) {
        this.memberFirstEmail = StringUtil.getEmptyStringIfNull(memberFirstEmail);
    }

    public String getMemberEmail() {
        return memberEmail;
    }
    public void setMemberEmail(String memberEmail) {
        this.memberEmail = StringUtil.getEmptyStringIfNull(memberEmail);
    }

    public int getMemberEmailVisible() {
        return memberEmailVisible;
    }
    public void setMemberEmailVisible(int memberEmailVisible) {
        this.memberEmailVisible = memberEmailVisible;
    }

    public int getMemberNameVisible() {
        return memberNameVisible;
    }
    public void setMemberNameVisible(int memberNameVisible) {
        this.memberNameVisible = memberNameVisible;
    }

    public String getMemberFirstIP() {
        return memberFirstIP;
    }
    public void setMemberFirstIP(String memberFirstIP) {
        this.memberFirstIP = StringUtil.getEmptyStringIfNull(memberFirstIP);
    }

    public String getMemberLastIP() {
        return memberLastIP;
    }
    public void setMemberLastIP(String memberLastIP) {
        this.memberLastIP = StringUtil.getEmptyStringIfNull(memberLastIP);
    }

    public int getMemberViewCount() {
        return memberViewCount;
    }
    public void setMemberViewCount(int memberViewCount) {
        this.memberViewCount = memberViewCount;
    }

    public int getMemberPostCount() {
        return memberPostCount;
    }
    public void setMemberPostCount(int memberPostCount) {
        this.memberPostCount = memberPostCount;
    }

    public Timestamp getMemberCreationDate() {
        return memberCreationDate;
    }
    public void setMemberCreationDate(Timestamp memberCreationDate) {
        this.memberCreationDate = memberCreationDate;
    }

    public Timestamp getMemberModifiedDate() {
        return memberModifiedDate;
    }
    public void setMemberModifiedDate(Timestamp memberModifiedDate) {
        this.memberModifiedDate = memberModifiedDate;
    }

    public Timestamp getMemberExpireDate() {
        return memberExpireDate;
    }
    public void setMemberExpireDate(Timestamp memberExpireDate) {
        this.memberExpireDate = memberExpireDate;
    }

    public Timestamp getMemberLastLogon() {
        return memberLastLogon;
    }
    public void setMemberLastLogon(Timestamp memberLastLogon) {
        this.memberLastLogon = memberLastLogon;
    }

    public int getMemberOption() {
        return memberOption;
    }
    public void setMemberOption(int memberOption) {
        this.memberOption = memberOption;
    }

    public int getMemberStatus() {
        return memberStatus;
    }
    public void setMemberStatus(int memberStatus) {
        this.memberStatus = memberStatus;
    }

    public String getMemberActivateCode() {
        return memberActivateCode;
    }
    public void setMemberActivateCode(String memberActivateCode) {
        this.memberActivateCode = StringUtil.getEmptyStringIfNull(memberActivateCode);
    }

    public int getMemberMessageCount() {
        return memberMessageCount;
    }
    public void setMemberMessageCount(int memberMessageCount) {
        this.memberMessageCount = memberMessageCount;
    }

    public int getMemberMessageOption() {
        return memberMessageOption;
    }
    public void setMemberMessageOption(int memberMessageOption) {
        this.memberMessageOption = memberMessageOption;
    }

    public int getMemberPostsPerPage() {
        return memberPostsPerPage;
    }
    public void setMemberPostsPerPage(int memberPostsPerPage) {
        this.memberPostsPerPage = memberPostsPerPage;
    }

    public int getMemberWarnCount() {
        return memberWarnCount;
    }
    public void setMemberWarnCount(int memberWarnCount) {
        this.memberWarnCount = memberWarnCount;
    }

    public int getMemberVoteCount() {
        return memberVoteCount;
    }
    public void setMemberVoteCount(int memberVoteCount) {
        this.memberVoteCount = memberVoteCount;
    }

    public int getMemberVoteTotalStars() {
        return memberVoteTotalStars;
    }
    public void setMemberVoteTotalStars(int memberVoteTotalStars) {
        this.memberVoteTotalStars = memberVoteTotalStars;
    }

    public int getMemberRewardPoints() {
        return memberRewardPoints;
    }
    public void setMemberRewardPoints(int memberRewardPoints) {
        this.memberRewardPoints = memberRewardPoints;
    }

    public String getMemberTitle() {
        return memberTitle;
    }
    public void setMemberTitle(String memberTitle) {
        this.memberTitle = StringUtil.getEmptyStringIfNull(memberTitle);
    }

    public int getMemberTimeZone() {
        return memberTimeZone;
    }
    public void setMemberTimeZone(int memberTimeZone) {
        this.memberTimeZone = memberTimeZone;
    }

    public String getMemberSignature() {
        return memberSignature;
    }
    public void setMemberSignature(String memberSignature) {
        this.memberSignature = StringUtil.getEmptyStringIfNull(memberSignature);
    }

    public String getMemberAvatar() {
        return memberAvatar;
    }
    public void setMemberAvatar(String memberAvatar) {
        this.memberAvatar = StringUtil.getEmptyStringIfNull(memberAvatar);
    }

    public String getMemberSkin() {
        return memberSkin;
    }
    public void setMemberSkin(String memberSkin) {
        this.memberSkin = StringUtil.getEmptyStringIfNull(memberSkin);
    }

    public String getMemberLanguage() {
        return memberLanguage;
    }
    public void setMemberLanguage(String memberLanguage) {
        this.memberLanguage = StringUtil.getEmptyStringIfNull(memberLanguage);
    }

    public String getMemberFirstname() {
        return memberFirstname;
    }
    public void setMemberFirstname(String memberFirstname) {
        this.memberFirstname = StringUtil.getEmptyStringIfNull(memberFirstname);
    }

    public String getMemberLastname() {
        return memberLastname;
    }
    public void setMemberLastname(String memberLastname) {
        this.memberLastname = StringUtil.getEmptyStringIfNull(memberLastname);
    }

    public int getMemberGender() {
        return memberGender;
    }
    public void setMemberGender(int memberGender) {
        this.memberGender = memberGender;
    }

    public Date getMemberBirthday() {
        return memberBirthday;
    }
    public void setMemberBirthday(Date memberBirthday) {
        this.memberBirthday = memberBirthday;
    }

    public String getMemberAddress() {
        return memberAddress;
    }
    public void setMemberAddress(String memberAddress) {
        this.memberAddress = StringUtil.getEmptyStringIfNull(memberAddress);
    }

    public String getMemberCity() {
        return memberCity;
    }
    public void setMemberCity(String memberCity) {
        this.memberCity = StringUtil.getEmptyStringIfNull(memberCity);
    }

    public String getMemberState() {
        return memberState;
    }
    public void setMemberState(String memberState) {
        this.memberState = StringUtil.getEmptyStringIfNull(memberState);
    }

    public String getMemberCountry() {
        return memberCountry;
    }
    public void setMemberCountry(String memberCountry) {
        this.memberCountry = StringUtil.getEmptyStringIfNull(memberCountry);
    }

    public String getMemberPhone() {
        return memberPhone;
    }
    public void setMemberPhone(String memberPhone) {
        this.memberPhone = StringUtil.getEmptyStringIfNull(memberPhone);
    }

    public String getMemberMobile() {
        return memberMobile;
    }
    public void setMemberMobile(String memberMobile) {
        this.memberMobile = StringUtil.getEmptyStringIfNull(memberMobile);
    }

    public String getMemberFax() {
        return memberFax;
    }
    public void setMemberFax(String memberFax) {
        this.memberFax = StringUtil.getEmptyStringIfNull(memberFax);
    }

    public String getMemberCareer() {
        return memberCareer;
    }
    public void setMemberCareer(String memberCareer) {
        this.memberCareer = StringUtil.getEmptyStringIfNull(memberCareer);
    }

    public String getMemberHomepage() {
        return memberHomepage;
    }
    public void setMemberHomepage(String memberHomepage) {
        this.memberHomepage = StringUtil.getEmptyStringIfNull(memberHomepage);
    }

    public String getMemberYahoo() {
        return memberYahoo;
    }
    public void setMemberYahoo(String memberYahoo) {
        this.memberYahoo = StringUtil.getEmptyStringIfNull(memberYahoo);
    }

    public String getMemberAol() {
        return memberAol;
    }
    public void setMemberAol(String memberAol) {
        this.memberAol = StringUtil.getEmptyStringIfNull(memberAol);
    }

    public String getMemberIcq() {
        return memberIcq;
    }
    public void setMemberIcq(String memberIcq) {
        this.memberIcq = StringUtil.getEmptyStringIfNull(memberIcq);
    }

    public String getMemberMsn() {
        return memberMsn;
    }
    public void setMemberMsn(String memberMsn) {
        this.memberMsn = StringUtil.getEmptyStringIfNull(memberMsn);
    }

    public String getMemberCoolLink1() {
        return memberCoolLink1;
    }
    public void setMemberCoolLink1(String memberCoolLink1) {
        this.memberCoolLink1 = StringUtil.getEmptyStringIfNull(memberCoolLink1);
    }

    public String getMemberCoolLink2() {
        return memberCoolLink2;
    }
    public void setMemberCoolLink2(String memberCoolLink2) {
        this.memberCoolLink2 = StringUtil.getEmptyStringIfNull(memberCoolLink2);
    }

    public String getXML() {
        StringBuffer xml = new StringBuffer(1024);
        xml.append("<MemberSection>\n");
        xml.append("  <Rows>\n");
        xml.append("    <Row>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberID\n");
        xml.append("        <Value>").append(String.valueOf(memberID)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberName\n");
        xml.append("        <Value>").append(String.valueOf(memberName)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberFirstEmail\n");
        xml.append("        <Value>").append(String.valueOf(memberFirstEmail)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberEmail\n");
        xml.append("        <Value>").append(String.valueOf(memberEmail)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberEmailVisible\n");
        xml.append("        <Value>").append(String.valueOf(memberEmailVisible)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberNameVisible\n");
        xml.append("        <Value>").append(String.valueOf(memberNameVisible)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberFirstIP\n");
        xml.append("        <Value>").append(String.valueOf(memberFirstIP)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberLastIP\n");
        xml.append("        <Value>").append(String.valueOf(memberLastIP)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberViewCount\n");
        xml.append("        <Value>").append(String.valueOf(memberViewCount)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberPostCount\n");
        xml.append("        <Value>").append(String.valueOf(memberPostCount)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCreationDate\n");
        xml.append("        <Value>").append(String.valueOf(memberCreationDate)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberModifiedDate\n");
        xml.append("        <Value>").append(String.valueOf(memberModifiedDate)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberExpireDate\n");
        xml.append("        <Value>").append(String.valueOf(memberExpireDate)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberLastLogon\n");
        xml.append("        <Value>").append(String.valueOf(memberLastLogon)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberOption\n");
        xml.append("        <Value>").append(String.valueOf(memberOption)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberStatus\n");
        xml.append("        <Value>").append(String.valueOf(memberStatus)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberActivateCode\n");
        xml.append("        <Value>").append(String.valueOf(memberActivateCode)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberMessageCount\n");
        xml.append("        <Value>").append(String.valueOf(memberMessageCount)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberMessageOption\n");
        xml.append("        <Value>").append(String.valueOf(memberMessageOption)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberPostsPerPage\n");
        xml.append("        <Value>").append(String.valueOf(memberPostsPerPage)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberWarnCount\n");
        xml.append("        <Value>").append(String.valueOf(memberWarnCount)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberVoteCount\n");
        xml.append("        <Value>").append(String.valueOf(memberVoteCount)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberVoteTotalStars\n");
        xml.append("        <Value>").append(String.valueOf(memberVoteTotalStars)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberRewardPoints\n");
        xml.append("        <Value>").append(String.valueOf(memberRewardPoints)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberTitle\n");
        xml.append("        <Value>").append(String.valueOf(memberTitle)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberTimeZone\n");
        xml.append("        <Value>").append(String.valueOf(memberTimeZone)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberSignature\n");
        xml.append("        <Value>").append(String.valueOf(memberSignature)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberAvatar\n");
        xml.append("        <Value>").append(String.valueOf(memberAvatar)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberSkin\n");
        xml.append("        <Value>").append(String.valueOf(memberSkin)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberLanguage\n");
        xml.append("        <Value>").append(String.valueOf(memberLanguage)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberFirstname\n");
        xml.append("        <Value>").append(String.valueOf(memberFirstname)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberLastname\n");
        xml.append("        <Value>").append(String.valueOf(memberLastname)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberGender\n");
        xml.append("        <Value>").append(String.valueOf(memberGender)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberBirthday\n");
        xml.append("        <Value>").append(String.valueOf(memberBirthday)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberAddress\n");
        xml.append("        <Value>").append(String.valueOf(memberAddress)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCity\n");
        xml.append("        <Value>").append(String.valueOf(memberCity)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberState\n");
        xml.append("        <Value>").append(String.valueOf(memberState)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCountry\n");
        xml.append("        <Value>").append(String.valueOf(memberCountry)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberPhone\n");
        xml.append("        <Value>").append(String.valueOf(memberPhone)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberMobile\n");
        xml.append("        <Value>").append(String.valueOf(memberMobile)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberFax\n");
        xml.append("        <Value>").append(String.valueOf(memberFax)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCareer\n");
        xml.append("        <Value>").append(String.valueOf(memberCareer)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberHomepage\n");
        xml.append("        <Value>").append(String.valueOf(memberHomepage)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberYahoo\n");
        xml.append("        <Value>").append(String.valueOf(memberYahoo)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberAol\n");
        xml.append("        <Value>").append(String.valueOf(memberAol)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberIcq\n");
        xml.append("        <Value>").append(String.valueOf(memberIcq)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberMsn\n");
        xml.append("        <Value>").append(String.valueOf(memberMsn)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCoolLink1\n");
        xml.append("        <Value>").append(String.valueOf(memberCoolLink1)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberCoolLink2\n");
        xml.append("        <Value>").append(String.valueOf(memberCoolLink2)).append("\n");
        xml.append("      </Column>\n");
        xml.append("    </Row>\n");
        xml.append("  </Rows>\n");
        xml.append("</MemberSection>\n");
        return xml.toString();
    }

    public static String getXML(Collection objMemberBeans) {
        StringBuffer xml = new StringBuffer(1024);
        Iterator iterator = objMemberBeans.iterator();
        xml.append("<MemberSection>\n");
        xml.append("  <Rows>\n");
        while (iterator.hasNext()) {
            MemberBean objMemberBean = (MemberBean)iterator.next();
            xml.append("    <Row>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberID\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberID)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberName\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberName)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberFirstEmail\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberFirstEmail)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberEmail\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberEmail)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberEmailVisible\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberEmailVisible)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberNameVisible\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberNameVisible)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberFirstIP\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberFirstIP)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberLastIP\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberLastIP)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberViewCount\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberViewCount)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberPostCount\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberPostCount)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCreationDate\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCreationDate)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberModifiedDate\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberModifiedDate)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberExpireDate\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberExpireDate)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberLastLogon\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberLastLogon)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberOption\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberOption)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberStatus\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberStatus)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberActivateCode\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberActivateCode)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberMessageCount\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberMessageCount)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberMessageOption\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberMessageOption)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberPostsPerPage\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberPostsPerPage)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberWarnCount\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberWarnCount)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberVoteCount\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberVoteCount)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberVoteTotalStars\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberVoteTotalStars)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberRewardPoints\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberRewardPoints)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberTitle\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberTitle)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberTimeZone\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberTimeZone)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberSignature\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberSignature)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberAvatar\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberAvatar)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberSkin\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberSkin)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberLanguage\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberLanguage)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberFirstname\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberFirstname)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberLastname\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberLastname)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberGender\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberGender)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberBirthday\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberBirthday)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberAddress\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberAddress)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCity\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCity)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberState\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberState)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCountry\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCountry)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberPhone\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberPhone)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberMobile\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberMobile)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberFax\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberFax)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCareer\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCareer)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberHomepage\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberHomepage)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberYahoo\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberYahoo)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberAol\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberAol)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberIcq\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberIcq)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberMsn\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberMsn)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCoolLink1\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCoolLink1)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberCoolLink2\n");
            xml.append("        <Value>").append(String.valueOf(objMemberBean.memberCoolLink2)).append("\n");
            xml.append("      </Column>\n");
            xml.append("    </Row>\n");
        }//while
        xml.append("  </Rows>\n");
        xml.append("</MemberSection>\n");
        return xml.toString();
    }

    /////////////////////////////////////////////////////////////////
    // utility methods
    /*
     * @todo : review these methods
     */
    public String getMemberGenderString() {
        if (memberGender == 1) return "Male";
        return "Female";
    }

    public String getMemberAvatar_processed() {
        if (memberAvatar.length() == 0) {// never null here, see setMemberAvatar
            return "";
        }
        String retMemberAvatar = memberAvatar;
        if (retMemberAvatar.equals(MemberBean.MEMBER_AVATAR_USING_UPLOAD) ||
            retMemberAvatar.startsWith(MVNForumGlobal.UPLOADED_AVATAR_DIR)) {
            //relative path
            retMemberAvatar = "getavatar?memberid=" + memberID;
        } else {
            // this mean use mvnForum's default avatar
            if (memberAvatar.startsWith("/mvnplugin")) {
                // no context prefix, so we prepend the contextPath
                retMemberAvatar = ParamUtil.getContextPath() + memberAvatar;
            }
        }
        return retMemberAvatar;
    }

    public String getMemberHomepage_http() {
        if (memberHomepage == null) memberHomepage = "";
        return Encoder.filterUrl(memberHomepage);
        /*
        String ret = memberHomepage.toLowerCase();
        if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
            ret = "http://" + ret;
        }
        return ret;
        */
    }

    public String getMemberCoolLink1_http() {
        if (memberCoolLink1 == null) memberCoolLink1 = "";
        return Encoder.filterUrl(memberCoolLink1);
        /*
        String ret = memberCoolLink1.toLowerCase();
        if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
            ret = "http://" + ret;
        }
        return ret;
        */
    }

    public String getMemberCoolLink2_http() {
        if (memberCoolLink2 == null) memberCoolLink2 = "";
        return Encoder.filterUrl(memberCoolLink2);
        /*
        String ret = memberCoolLink2.toLowerCase();
        if ( (ret.length() > 0) && (!ret.startsWith("http://")) ) {
            ret = "http://" + ret;
        }
        return ret;
        */
    }

    public String getMemberCreationDate_short() {
        return DateUtil.getDateDDMMYYYY(memberCreationDate);
    }

    public String getMemberExpireDate_short() {
        return DateUtil.getDateDDMMYYYY(memberExpireDate);
    }

    public boolean isInvisible() {
        return (this.memberNameVisible == MEMBER_NAME_INVISIBLE);
    }

    public boolean showEmail() {
        return (this.memberEmailVisible == MEMBER_EMAIL_VISIBLE);
    }

} //end of class MemberBean




my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.