001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/jdbc/ForumDAOImplXML.java,v 1.3 2007/01/15 10:27:12 dungbtm Exp $
003: * $Author: dungbtm $
004: * $Revision: 1.3 $
005: * $Date: 2007/01/15 10:27:12 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author:
039: */
040: package org.mvnforum.phpbb2mvnforum.db.jdbc;
041:
042: import java.sql.Timestamp;
043: import java.util.Collection;
044: import java.util.Iterator;
045:
046: import net.myvietnam.mvncore.exception.CreateException;
047: import net.myvietnam.mvncore.exception.DatabaseException;
048: import net.myvietnam.mvncore.exception.DuplicateKeyException;
049: import net.myvietnam.mvncore.exception.ObjectNotFoundException;
050:
051: import org.mvnforum.phpbb2mvnforum.db.ForumBean;
052: import org.mvnforum.phpbb2mvnforum.db.ForumDAO;
053: import org.mvnforum.util.DBUtils;
054: import org.w3c.dom.Document;
055: import org.w3c.dom.Element;
056:
057: public class ForumDAOImplXML implements ForumDAO {
058:
059: public void findByPrimaryKey(int forumID)
060: throws ObjectNotFoundException, DatabaseException {
061: // TODO Auto-generated method stub
062:
063: }
064:
065: public void findByAlternateKey_ForumName_CategoryID(
066: String forumName, int categoryID)
067: throws ObjectNotFoundException, DatabaseException {
068: // TODO Auto-generated method stub
069:
070: }
071:
072: public void create(int forumID, int categoryID,
073: String lastPostMemberName, String forumName,
074: String forumDesc, Timestamp forumCreationDate,
075: Timestamp forumModifiedDate, Timestamp forumLastPostDate,
076: int forumOrder, int forumType, int forumFormatOption,
077: int forumOption, int forumStatus, int forumModerationMode,
078: String forumPassword, int forumThreadCount,
079: int forumPostCount) throws CreateException,
080: DatabaseException, DuplicateKeyException {
081:
082: ForumBean bean = new ForumBean();
083: bean.setForumID(forumID);
084: bean.setCategoryID(categoryID);
085: bean.setLastPostMemberName(lastPostMemberName);
086: bean.setForumName(forumName);
087: bean.setForumDesc(forumDesc);
088: bean.setForumCreationDate(forumCreationDate);
089: bean.setForumModifiedDate(forumModifiedDate);
090: bean.setForumLastPostDate(forumLastPostDate);
091: bean.setForumOrder(forumOrder);
092: bean.setForumType(forumType);
093: bean.setForumFormatOption(forumFormatOption);
094: bean.setForumOption(forumOption);
095: bean.setForumStatus(forumStatus);
096: bean.setForumModerationMode(forumModerationMode);
097: bean.setForumPassword(forumPassword);
098: bean.setForumThreadCount(forumThreadCount);
099: bean.setForumPostCount(forumPostCount);
100:
101: }
102:
103: public void createMultiple(Collection beans) {
104:
105: Document doc = DBUtils.getDomDocument();
106: Element element = doc.createElement("ForumList");
107: doc.getFirstChild().appendChild(element);
108: for (Iterator iter = beans.iterator(); iter.hasNext();) {
109: ForumBean bean = (ForumBean) iter.next();
110: bean.getBeanDocument(doc, element);
111: }
112: //DBUtils.writeXmlFile(doc, Phpbb2MvnforumConfig.EXPORT_XML);
113:
114: }
115:
116: }
|