KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mvnforum > phpbb2mvnforum > db > jdbc > CategoryDAOImplXML


1 package org.mvnforum.phpbb2mvnforum.db.jdbc;
2
3 import java.io.FileInputStream JavaDoc;
4 import java.io.FileOutputStream JavaDoc;
5 import java.sql.Timestamp JavaDoc;
6 import java.util.Collection JavaDoc;
7 import java.util.Iterator JavaDoc;
8
9 import org.mvnforum.phpbb2mvnforum.db.CategoryBean;
10 import org.mvnforum.phpbb2mvnforum.db.CategoryDAO;
11 import org.mvnforum.util.DBUtils;
12 import org.mvnforum.util.Phpbb2MvnforumConfig;
13 import org.w3c.dom.Document JavaDoc;
14 import org.w3c.dom.Element JavaDoc;
15
16 import net.myvietnam.mvncore.exception.CreateException;
17 import net.myvietnam.mvncore.exception.DatabaseException;
18 import net.myvietnam.mvncore.exception.DuplicateKeyException;
19 import net.myvietnam.mvncore.exception.ObjectNotFoundException;
20
21 public class CategoryDAOImplXML implements CategoryDAO {
22
23     public void findByPrimaryKey(int categoryID)
24         throws ObjectNotFoundException, DatabaseException {
25         // TODO Auto-generated method stub
26

27     }
28
29     public void findByAlternateKey_CategoryName(String JavaDoc categoryName)
30         throws ObjectNotFoundException, DatabaseException {
31         // TODO Auto-generated method stub
32

33     }
34
35     public void create(int categoryID, int parentCategoryID, String JavaDoc categoryName, String JavaDoc categoryDesc,
36             Timestamp JavaDoc categoryCreationDate, Timestamp JavaDoc categoryModifiedDate, int categoryOrder, int categoryOption,
37             int categoryStatus)
38         throws CreateException, DatabaseException, DuplicateKeyException {
39         // TODO Auto-generated method stub
40

41         CategoryBean bean = new CategoryBean();
42         bean.setCategoryID(categoryID);
43         bean.setParentCategoryID(parentCategoryID);
44         bean.setCategoryName(categoryName);
45         bean.setCategoryDesc(categoryDesc);
46         bean.setCategoryCreationDate(categoryCreationDate);
47         bean.setCategoryModifiedDate(categoryModifiedDate);
48         bean.setCategoryOrder(categoryOrder);
49         bean.setCategoryOption(categoryOption);
50         bean.setCategoryStatus(categoryStatus);
51     }
52
53     public void createMultiple(Collection JavaDoc beans) {
54         // TODO Auto-generated method stub
55
Document JavaDoc doc = DBUtils.getDomDocument();
56         Element JavaDoc element = doc.createElement("CategoryList");
57         doc.getFirstChild().appendChild(element);
58         for (Iterator JavaDoc iter = beans.iterator(); iter.hasNext(); ) {
59             CategoryBean bean = (CategoryBean)iter.next();
60             bean.getBeanDocument(doc, element);
61         }
62         //DBUtils.writeXmlFile(doc, Phpbb2MvnforumConfig.EXPORT_XML);
63
}
64     
65     
66 }
67
Popular Tags