KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > GroupForumBean


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/GroupForumBean.java,v 1.5 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.5 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  * @author: Mai Nguyen
40  */

41 package com.mvnforum.db;
42
43 import java.util.Collection JavaDoc;
44 import java.util.Iterator JavaDoc;
45
46 /*
47  * Included columns: GroupID, ForumID, Permission
48  * Excluded columns:
49  */

50 public class GroupForumBean {
51     private int groupID;
52     private int forumID;
53     private int permission;
54
55     public int getGroupID() {
56         return groupID;
57     }
58     public void setGroupID(int groupID) {
59         this.groupID = groupID;
60     }
61
62     public int getForumID() {
63         return forumID;
64     }
65     public void setForumID(int forumID) {
66         this.forumID = forumID;
67     }
68
69     public int getPermission() {
70         return permission;
71     }
72     public void setPermission(int permission) {
73         this.permission = permission;
74     }
75
76     public String JavaDoc getXML() {
77         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
78         xml.append("<GroupForumSection>\n");
79         xml.append(" <Rows>\n");
80         xml.append(" <Row>\n");
81         xml.append(" <Column>\n");
82         xml.append(" <Name>GroupID</Name>\n");
83         xml.append(" <Value>").append(String.valueOf(groupID)).append("</Value>\n");
84         xml.append(" </Column>\n");
85         xml.append(" <Column>\n");
86         xml.append(" <Name>ForumID</Name>\n");
87         xml.append(" <Value>").append(String.valueOf(forumID)).append("</Value>\n");
88         xml.append(" </Column>\n");
89         xml.append(" <Column>\n");
90         xml.append(" <Name>Permission</Name>\n");
91         xml.append(" <Value>").append(String.valueOf(permission)).append("</Value>\n");
92         xml.append(" </Column>\n");
93         xml.append(" </Row>\n");
94         xml.append(" </Rows>\n");
95         xml.append("</GroupForumSection>\n");
96         return xml.toString();
97     }
98
99     public static String JavaDoc getXML(Collection JavaDoc objGroupForumBeans) {
100         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
101         Iterator JavaDoc iterator = objGroupForumBeans.iterator();
102         xml.append("<GroupForumSection>\n");
103         xml.append(" <Rows>\n");
104         while (iterator.hasNext()) {
105             GroupForumBean objGroupForumBean = (GroupForumBean)iterator.next();
106             xml.append(" <Row>\n");
107             xml.append(" <Column>\n");
108             xml.append(" <Name>GroupID</Name>\n");
109             xml.append(" <Value>").append(String.valueOf(objGroupForumBean.groupID)).append("</Value>\n");
110             xml.append(" </Column>\n");
111             xml.append(" <Column>\n");
112             xml.append(" <Name>ForumID</Name>\n");
113             xml.append(" <Value>").append(String.valueOf(objGroupForumBean.forumID)).append("</Value>\n");
114             xml.append(" </Column>\n");
115             xml.append(" <Column>\n");
116             xml.append(" <Name>Permission</Name>\n");
117             xml.append(" <Value>").append(String.valueOf(objGroupForumBean.permission)).append("</Value>\n");
118             xml.append(" </Column>\n");
119             xml.append(" </Row>\n");
120         }//while
121
xml.append(" </Rows>\n");
122         xml.append("</GroupForumSection>\n");
123         return xml.toString();
124     }
125
126     /************************************************
127      * Customized methods come below
128      ************************************************/

129     private GroupsBean groupsBean = null;
130
131     public GroupsBean getGroupsBean() {
132         return groupsBean;
133     }
134     public void setGroupsBean(GroupsBean groupsBean) {
135         this.groupsBean = groupsBean;
136     }
137
138 } //end of class GroupForumBean
139
Popular Tags