001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/jdbc/CategoryDAOImplXML.java,v 1.4 2007/01/15 10:27:12 dungbtm Exp $
003: * $Author: dungbtm $
004: * $Revision: 1.4 $
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 org.mvnforum.phpbb2mvnforum.db.CategoryBean;
047: import org.mvnforum.phpbb2mvnforum.db.CategoryDAO;
048: import org.mvnforum.util.DBUtils;
049: import org.w3c.dom.Document;
050: import org.w3c.dom.Element;
051:
052: import net.myvietnam.mvncore.exception.CreateException;
053: import net.myvietnam.mvncore.exception.DatabaseException;
054: import net.myvietnam.mvncore.exception.DuplicateKeyException;
055: import net.myvietnam.mvncore.exception.ObjectNotFoundException;
056:
057: public class CategoryDAOImplXML implements CategoryDAO {
058:
059: public void findByPrimaryKey(int categoryID)
060: throws ObjectNotFoundException, DatabaseException {
061:
062: }
063:
064: public void findByAlternateKey_CategoryName(String categoryName)
065: throws ObjectNotFoundException, DatabaseException {
066:
067: }
068:
069: public void create(int categoryID, int parentCategoryID,
070: String categoryName, String categoryDesc,
071: Timestamp categoryCreationDate,
072: Timestamp categoryModifiedDate, int categoryOrder,
073: int categoryOption, int categoryStatus)
074: throws CreateException, DatabaseException,
075: DuplicateKeyException {
076:
077: CategoryBean bean = new CategoryBean();
078: bean.setCategoryID(categoryID);
079: bean.setParentCategoryID(parentCategoryID);
080: bean.setCategoryName(categoryName);
081: bean.setCategoryDesc(categoryDesc);
082: bean.setCategoryCreationDate(categoryCreationDate);
083: bean.setCategoryModifiedDate(categoryModifiedDate);
084: bean.setCategoryOrder(categoryOrder);
085: bean.setCategoryOption(categoryOption);
086: bean.setCategoryStatus(categoryStatus);
087: }
088:
089: public void createMultiple(Collection beans) {
090: Document doc = DBUtils.getDomDocument();
091: Element element = doc.createElement("CategoryList");
092: doc.getFirstChild().appendChild(element);
093: for (Iterator iter = beans.iterator(); iter.hasNext();) {
094: CategoryBean bean = (CategoryBean) iter.next();
095: bean.getBeanDocument(doc, element);
096: }
097: //DBUtils.writeXmlFile(doc, Phpbb2MvnforumConfig.EXPORT_XML);
098: }
099:
100: }
|