?? memberdaoimplbaseonportal.java
字號(hào):
/*
* $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/portal/MemberDAOImplBaseOnPortal.java,v 1.6 2006/04/14 16:29:57 minhnn Exp $
* $Author: minhnn $
* $Revision: 1.6 $
* $Date: 2006/04/14 16:29:57 $
*
* ====================================================================
*
* Copyright (C) 2002-2006 by MyVietnam.net
*
* 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 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.
*
* 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 at MyVietnam net
*
* @author: Phong Ta
*/
package com.mvnforum.db.portal;
import java.sql.*;
import java.sql.Date;
import java.util.Collection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.mvnforum.db.*;
import net.myvietnam.mvncore.db.DBUtils;
import net.myvietnam.mvncore.exception.*;
public class MemberDAOImplBaseOnPortal implements MemberDAO {
private static Log log = LogFactory.getLog(MemberDAOImplBaseOnPortal.class);
//private MemberDAO memberDAO = new MemberDAOImplJDBC();
// To create forum-account if this is the first time the existing member go to the forum in portal
public void create(String memberName, String memberPassword, String memberFirstEmail, String memberEmail, int memberEmailVisible, int memberNameVisible, String memberFirstIP, String memberLastIP, int memberViewCount, int memberPostCount, Timestamp memberCreationDate, Timestamp memberModifiedDate, Timestamp memberExpireDate, Timestamp memberLastLogon, int memberOption, int memberStatus, String memberActivateCode, String memberTempPassword, int memberMessageCount, int memberMessageOption, int memberPostsPerPage, int memberWarnCount, int memberVoteCount, int memberVoteTotalStars, int memberRewardPoints, String memberTitle, double memberTimeZone, String memberSignature, String memberAvatar, String memberSkin, String memberLanguage, String memberFirstname, String memberLastname, int memberGender, Date memberBirthday, String memberAddress, String memberCity, String memberState, String memberCountry, String memberPhone, String memberMobile, String memberFax, String memberCareer, String memberHomepage, String memberYahoo, String memberAol, String memberIcq, String memberMsn, String memberCoolLink1, String memberCoolLink2) throws CreateException, DatabaseException, DuplicateKeyException {
/*
memberDAO.create(memberName, memberPassword, memberFirstEmail, memberEmail,
memberEmailVisible, memberNameVisible, memberFirstIP, memberLastIP, memberViewCount,
memberPostCount, memberCreationDate, memberModifiedDate, memberExpireDate,
memberLastLogon, memberOption, memberStatus, memberActivateCode, memberTempPassword,
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);
*/
throw new IllegalStateException();
}
public final String getNameFromID(int memberID)
throws ObjectNotFoundException, DatabaseException {
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
String sql = "SELECT MemberName FROM " + TABLE_NAME + " WHERE MemberID = ?";
try {
connection = DBUtils.getConnection();
statement = connection.prepareStatement(sql);
statement.setInt(1, memberID);
resultSet = statement.executeQuery();
if(!resultSet.next()) {
throw new ObjectNotFoundException("Cannot find the row in table Member where MemberName = " + memberID);
}
return resultSet.getString(1);
} catch(SQLException sqle) {
log.error("Sql Execution Error!", sqle);
throw new DatabaseException("Error executing SQL in MemberDAOImplJDBC.getMemberIDFromMemberName.");
} finally {
DBUtils.closeResultSet(resultSet);
DBUtils.closeStatement(statement);
DBUtils.closeConnection(connection);
}
}
public void deleteByPrimaryKey(int memberID) throws DatabaseException {
throw new IllegalStateException();
}
public void findByAlternateKey_MemberEmail(String memberEmail) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
// check reference to the other tables in forum portlet
public void findByAlternateKey_MemberName(String memberName) throws ObjectNotFoundException, DatabaseException {
//memberDAO.findByAlternateKey_MemberName(memberName);
DAOFactory.getLocalMemberDAO().findByAlternateKey_MemberName(memberName);
}
// check reference to the other tables in forum portlet
public void findByPrimaryKey(int memberID) throws ObjectNotFoundException, DatabaseException {
//memberDAO.findByPrimaryKey(memberID);
DAOFactory.getLocalMemberDAO().findByPrimaryKey(memberID);
}
// check reference to the other tables in forum portlet
public void findByPrimaryKey2(int memberID, String memberName) throws ObjectNotFoundException, DatabaseException {
//memberDAO.findByPrimaryKey2(memberID, memberName);
DAOFactory.getLocalMemberDAO().findByPrimaryKey2(memberID, memberName);
}
public String getActivateCode(int memberID) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public Collection getAuthorizedMembers() throws DatabaseException {
throw new IllegalStateException();
}
public Collection getEnableMembers_inActivationStatus(String kind) throws DatabaseException {
throw new IllegalStateException();
}
public Collection getEnableMembers_inGroup(int groupID) throws DatabaseException {
throw new IllegalStateException();
}
public Collection getForumsAuthorizedMembers() throws DatabaseException {
throw new IllegalStateException();
}
public MemberBean getMember_forEditCurrentMember(int memberID) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
// Temporarily, to get member information when list post in a certain thread
public MemberBean getMember_forPublic(int memberID) throws ObjectNotFoundException, DatabaseException {
//return memberDAO.getMember_forPublic(memberID);
return DAOFactory.getLocalMemberDAO().getMember_forPublic(memberID);
//throw new IllegalStateException();
}
public MemberBean getMember_forViewCurrentMember(int memberID) throws ObjectNotFoundException, DatabaseException {
//return memberDAO.getMember_forViewCurrentMember(memberID);
return DAOFactory.getLocalMemberDAO().getMember_forViewCurrentMember(memberID);
//throw new IllegalStateException();
}
public int getMemberIDFromMemberEmail(String memberEmail) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
// we need this method because the viewmember and login need this method
public int getMemberIDFromMemberName(String memberName) throws ObjectNotFoundException, DatabaseException {
//return memberDAO.getMemberIDFromMemberName(memberName);
return DAOFactory.getLocalMemberDAO().getMemberIDFromMemberName(memberName);
}
public MemberBean getMemberFromMemberName(String memberName) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public Collection getMembers_inExpire_limit(Timestamp expireDate, int offset, int rowsToReturn, String sort, String order) throws IllegalArgumentException, DatabaseException {
throw new IllegalStateException();
}
public Collection getMembers_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) throws IllegalArgumentException, DatabaseException {
throw new IllegalStateException();
}
public Collection getMembers() throws DatabaseException {
throw new IllegalStateException();
}
public Collection getNonActivatedNoPostMembers(Timestamp before) throws DatabaseException {
throw new IllegalStateException();
}
public int getNumberOfMembers_inActivationStatus(boolean activationStatus) throws AssertionException, DatabaseException {
throw new IllegalStateException();
}
public int getNumberOfMembers_inExpire(Timestamp expireDate) throws AssertionException, DatabaseException {
throw new IllegalStateException();
}
public int getNumberOfMembers_inMemberStatus(int memberStatus) throws AssertionException, DatabaseException {
throw new IllegalStateException();
}
// Ensure the forum is inited successfully @see com.mvnforum.MVNForumConfig
public int getNumberOfMembers() throws AssertionException, DatabaseException {
//return memberDAO.getNumberOfMembers();
return DAOFactory.getLocalMemberDAO().getNumberOfMembers();
}
public String getPassword(int memberID) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public String getTempPassword(int memberID) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
// it is neccessary to change post count
public void increasePostCount(int memberID) throws DatabaseException, ObjectNotFoundException {
//memberDAO.increasePostCount(memberID);
DAOFactory.getLocalMemberDAO().increasePostCount(memberID);
}
// it is neccessary to change view count
public void increaseViewCount(int memberID) throws DatabaseException, ObjectNotFoundException {
//memberDAO.increaseViewCount(memberID);
DAOFactory.getLocalMemberDAO().increasePostCount(memberID);
}
public void update(int memberID, int memberEmailVisible, int memberNameVisible, Timestamp memberModifiedDate, int memberOption, int memberStatus, int memberMessageOption, int memberPostsPerPage, double memberTimeZone, String memberSkin, String memberLanguage, String memberFirstname, String memberLastname, int memberGender, Date memberBirthday, String memberAddress, String memberCity, String memberState, String memberCountry, String memberPhone, String memberMobile, String memberFax, String memberCareer, String memberHomepage, String memberYahoo, String memberAol, String memberIcq, String memberMsn, String memberCoolLink1, String memberCoolLink2) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateActivateCode(int memberID, String memberActivateCode) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateAvatar(int memberID, String memberAvatar) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateEmail(int memberID, String memberEmail) throws ObjectNotFoundException, DatabaseException, DuplicateKeyException {
throw new IllegalStateException();
}
public void updateLastLogon(int memberID, Timestamp memberLastLogon, String lastIP) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateMember_expireDate(int memberID, Timestamp expireDate) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updatePassword(int memberID, String memberPassword) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updatePostCount(int memberID, int memberPostCount) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateSignature(int memberID, String memberSignature) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateStatus(int memberID, int memberStatus) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateTempPassword(int memberID, String memberTempPassword) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
public void updateTitle(int memberID, String memberTitle) throws ObjectNotFoundException, DatabaseException {
throw new IllegalStateException();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -