001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/PhpbbForum.java,v 1.3 2007/01/15 10:27:33 dungbtm Exp $
003: * $Author: dungbtm $
004: * $Revision: 1.3 $
005: * $Date: 2007/01/15 10:27:33 $
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;
041:
042: import java.util.Collection;//for xml support
043: import java.util.Iterator;//for xml support
044:
045: /*
046: * Included columns: forum_id, cat_id, forum_name, forum_desc, forum_status,
047: * forum_order, forum_posts, forum_topics, forum_last_post_id, prune_next,
048: * prune_enable, auth_view, auth_read, auth_post, auth_reply,
049: * auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote,
050: * auth_pollcreate, auth_attachments
051: * Excluded columns:
052: */
053: public class PhpbbForum {
054: private int forum_id;
055: private int cat_id;
056: private String forum_name;
057: private String forum_desc;
058: private int forum_status;
059: private int forum_order;
060: private int forum_posts;
061: private int forum_topics;
062: private int forum_last_post_id;
063: private int prune_next;
064: private int prune_enable;
065: private int auth_view;
066: private int auth_read;
067: private int auth_post;
068: private int auth_reply;
069: private int auth_edit;
070: private int auth_delete;
071: private int auth_sticky;
072: private int auth_announce;
073: private int auth_vote;
074: private int auth_pollcreate;
075: private int auth_attachments;
076:
077: public int getforum_id() {
078: return forum_id;
079: }
080:
081: public void setforum_id(int forum_id) {
082: this .forum_id = forum_id;
083: }
084:
085: public int getcat_id() {
086: return cat_id;
087: }
088:
089: public void setcat_id(int cat_id) {
090: this .cat_id = cat_id;
091: }
092:
093: public String getforum_name() {
094: return forum_name;
095: }
096:
097: public void setforum_name(String forum_name) {
098: this .forum_name = forum_name;
099: }
100:
101: public String getforum_desc() {
102: return forum_desc;
103: }
104:
105: public void setforum_desc(String forum_desc) {
106: this .forum_desc = forum_desc;
107: }
108:
109: public int getforum_status() {
110: return forum_status;
111: }
112:
113: public void setforum_status(int forum_status) {
114: this .forum_status = forum_status;
115: }
116:
117: public int getforum_order() {
118: return forum_order;
119: }
120:
121: public void setforum_order(int forum_order) {
122: this .forum_order = forum_order;
123: }
124:
125: public int getforum_posts() {
126: return forum_posts;
127: }
128:
129: public void setforum_posts(int forum_posts) {
130: this .forum_posts = forum_posts;
131: }
132:
133: public int getforum_topics() {
134: return forum_topics;
135: }
136:
137: public void setforum_topics(int forum_topics) {
138: this .forum_topics = forum_topics;
139: }
140:
141: public int getforum_last_post_id() {
142: return forum_last_post_id;
143: }
144:
145: public void setforum_last_post_id(int forum_last_post_id) {
146: this .forum_last_post_id = forum_last_post_id;
147: }
148:
149: public int getprune_next() {
150: return prune_next;
151: }
152:
153: public void setprune_next(int prune_next) {
154: this .prune_next = prune_next;
155: }
156:
157: public int getprune_enable() {
158: return prune_enable;
159: }
160:
161: public void setprune_enable(int prune_enable) {
162: this .prune_enable = prune_enable;
163: }
164:
165: public int getauth_view() {
166: return auth_view;
167: }
168:
169: public void setauth_view(int auth_view) {
170: this .auth_view = auth_view;
171: }
172:
173: public int getauth_read() {
174: return auth_read;
175: }
176:
177: public void setauth_read(int auth_read) {
178: this .auth_read = auth_read;
179: }
180:
181: public int getauth_post() {
182: return auth_post;
183: }
184:
185: public void setauth_post(int auth_post) {
186: this .auth_post = auth_post;
187: }
188:
189: public int getauth_reply() {
190: return auth_reply;
191: }
192:
193: public void setauth_reply(int auth_reply) {
194: this .auth_reply = auth_reply;
195: }
196:
197: public int getauth_edit() {
198: return auth_edit;
199: }
200:
201: public void setauth_edit(int auth_edit) {
202: this .auth_edit = auth_edit;
203: }
204:
205: public int getauth_delete() {
206: return auth_delete;
207: }
208:
209: public void setauth_delete(int auth_delete) {
210: this .auth_delete = auth_delete;
211: }
212:
213: public int getauth_sticky() {
214: return auth_sticky;
215: }
216:
217: public void setauth_sticky(int auth_sticky) {
218: this .auth_sticky = auth_sticky;
219: }
220:
221: public int getauth_announce() {
222: return auth_announce;
223: }
224:
225: public void setauth_announce(int auth_announce) {
226: this .auth_announce = auth_announce;
227: }
228:
229: public int getauth_vote() {
230: return auth_vote;
231: }
232:
233: public void setauth_vote(int auth_vote) {
234: this .auth_vote = auth_vote;
235: }
236:
237: public int getauth_pollcreate() {
238: return auth_pollcreate;
239: }
240:
241: public void setauth_pollcreate(int auth_pollcreate) {
242: this .auth_pollcreate = auth_pollcreate;
243: }
244:
245: public int getauth_attachments() {
246: return auth_attachments;
247: }
248:
249: public void setauth_attachments(int auth_attachments) {
250: this .auth_attachments = auth_attachments;
251: }
252:
253: public String getXML() {
254: StringBuffer xml = new StringBuffer(1024);
255: xml.append("<phpbb_forumsSection>\n");
256: xml.append(" <Rows>\n");
257: xml.append(" <Row>\n");
258: xml.append(" <Column>\n");
259: xml.append(" <Name>forum_id</Name>\n");
260: xml.append(" <Value>").append(String.valueOf(forum_id))
261: .append("</Value>\n");
262: xml.append(" </Column>\n");
263: xml.append(" <Column>\n");
264: xml.append(" <Name>cat_id</Name>\n");
265: xml.append(" <Value>").append(String.valueOf(cat_id))
266: .append("</Value>\n");
267: xml.append(" </Column>\n");
268: xml.append(" <Column>\n");
269: xml.append(" <Name>forum_name</Name>\n");
270: xml.append(" <Value>")
271: .append(String.valueOf(forum_name))
272: .append("</Value>\n");
273: xml.append(" </Column>\n");
274: xml.append(" <Column>\n");
275: xml.append(" <Name>forum_desc</Name>\n");
276: xml.append(" <Value>")
277: .append(String.valueOf(forum_desc))
278: .append("</Value>\n");
279: xml.append(" </Column>\n");
280: xml.append(" <Column>\n");
281: xml.append(" <Name>forum_status</Name>\n");
282: xml.append(" <Value>").append(
283: String.valueOf(forum_status)).append("</Value>\n");
284: xml.append(" </Column>\n");
285: xml.append(" <Column>\n");
286: xml.append(" <Name>forum_order</Name>\n");
287: xml.append(" <Value>").append(
288: String.valueOf(forum_order)).append("</Value>\n");
289: xml.append(" </Column>\n");
290: xml.append(" <Column>\n");
291: xml.append(" <Name>forum_posts</Name>\n");
292: xml.append(" <Value>").append(
293: String.valueOf(forum_posts)).append("</Value>\n");
294: xml.append(" </Column>\n");
295: xml.append(" <Column>\n");
296: xml.append(" <Name>forum_topics</Name>\n");
297: xml.append(" <Value>").append(
298: String.valueOf(forum_topics)).append("</Value>\n");
299: xml.append(" </Column>\n");
300: xml.append(" <Column>\n");
301: xml.append(" <Name>forum_last_post_id</Name>\n");
302: xml.append(" <Value>").append(
303: String.valueOf(forum_last_post_id))
304: .append("</Value>\n");
305: xml.append(" </Column>\n");
306: xml.append(" <Column>\n");
307: xml.append(" <Name>prune_next</Name>\n");
308: xml.append(" <Value>")
309: .append(String.valueOf(prune_next))
310: .append("</Value>\n");
311: xml.append(" </Column>\n");
312: xml.append(" <Column>\n");
313: xml.append(" <Name>prune_enable</Name>\n");
314: xml.append(" <Value>").append(
315: String.valueOf(prune_enable)).append("</Value>\n");
316: xml.append(" </Column>\n");
317: xml.append(" <Column>\n");
318: xml.append(" <Name>auth_view</Name>\n");
319: xml.append(" <Value>").append(String.valueOf(auth_view))
320: .append("</Value>\n");
321: xml.append(" </Column>\n");
322: xml.append(" <Column>\n");
323: xml.append(" <Name>auth_read</Name>\n");
324: xml.append(" <Value>").append(String.valueOf(auth_read))
325: .append("</Value>\n");
326: xml.append(" </Column>\n");
327: xml.append(" <Column>\n");
328: xml.append(" <Name>auth_post</Name>\n");
329: xml.append(" <Value>").append(String.valueOf(auth_post))
330: .append("</Value>\n");
331: xml.append(" </Column>\n");
332: xml.append(" <Column>\n");
333: xml.append(" <Name>auth_reply</Name>\n");
334: xml.append(" <Value>")
335: .append(String.valueOf(auth_reply))
336: .append("</Value>\n");
337: xml.append(" </Column>\n");
338: xml.append(" <Column>\n");
339: xml.append(" <Name>auth_edit</Name>\n");
340: xml.append(" <Value>").append(String.valueOf(auth_edit))
341: .append("</Value>\n");
342: xml.append(" </Column>\n");
343: xml.append(" <Column>\n");
344: xml.append(" <Name>auth_delete</Name>\n");
345: xml.append(" <Value>").append(
346: String.valueOf(auth_delete)).append("</Value>\n");
347: xml.append(" </Column>\n");
348: xml.append(" <Column>\n");
349: xml.append(" <Name>auth_sticky</Name>\n");
350: xml.append(" <Value>").append(
351: String.valueOf(auth_sticky)).append("</Value>\n");
352: xml.append(" </Column>\n");
353: xml.append(" <Column>\n");
354: xml.append(" <Name>auth_announce</Name>\n");
355: xml.append(" <Value>").append(
356: String.valueOf(auth_announce)).append("</Value>\n");
357: xml.append(" </Column>\n");
358: xml.append(" <Column>\n");
359: xml.append(" <Name>auth_vote</Name>\n");
360: xml.append(" <Value>").append(String.valueOf(auth_vote))
361: .append("</Value>\n");
362: xml.append(" </Column>\n");
363: xml.append(" <Column>\n");
364: xml.append(" <Name>auth_pollcreate</Name>\n");
365: xml.append(" <Value>").append(
366: String.valueOf(auth_pollcreate)).append("</Value>\n");
367: xml.append(" </Column>\n");
368: xml.append(" <Column>\n");
369: xml.append(" <Name>auth_attachments</Name>\n");
370: xml.append(" <Value>").append(
371: String.valueOf(auth_attachments)).append("</Value>\n");
372: xml.append(" </Column>\n");
373: xml.append(" </Row>\n");
374: xml.append(" </Rows>\n");
375: xml.append("</phpbb_forumsSection>\n");
376: return xml.toString();
377: }
378:
379: public static String getXML(Collection objphpbb_forumsBeans) {
380: StringBuffer xml = new StringBuffer(1024);
381: Iterator iterator = objphpbb_forumsBeans.iterator();
382: xml.append("<phpbb_forumsSection>\n");
383: xml.append(" <Rows>\n");
384: while (iterator.hasNext()) {
385: PhpbbForum objphpbb_forumsBean = (PhpbbForum) iterator
386: .next();
387: xml.append(" <Row>\n");
388: xml.append(" <Column>\n");
389: xml.append(" <Name>forum_id</Name>\n");
390: xml.append(" <Value>").append(
391: String.valueOf(objphpbb_forumsBean.forum_id))
392: .append("</Value>\n");
393: xml.append(" </Column>\n");
394: xml.append(" <Column>\n");
395: xml.append(" <Name>cat_id</Name>\n");
396: xml.append(" <Value>").append(
397: String.valueOf(objphpbb_forumsBean.cat_id)).append(
398: "</Value>\n");
399: xml.append(" </Column>\n");
400: xml.append(" <Column>\n");
401: xml.append(" <Name>forum_name</Name>\n");
402: xml.append(" <Value>").append(
403: String.valueOf(objphpbb_forumsBean.forum_name))
404: .append("</Value>\n");
405: xml.append(" </Column>\n");
406: xml.append(" <Column>\n");
407: xml.append(" <Name>forum_desc</Name>\n");
408: xml.append(" <Value>").append(
409: String.valueOf(objphpbb_forumsBean.forum_desc))
410: .append("</Value>\n");
411: xml.append(" </Column>\n");
412: xml.append(" <Column>\n");
413: xml.append(" <Name>forum_status</Name>\n");
414: xml.append(" <Value>").append(
415: String.valueOf(objphpbb_forumsBean.forum_status))
416: .append("</Value>\n");
417: xml.append(" </Column>\n");
418: xml.append(" <Column>\n");
419: xml.append(" <Name>forum_order</Name>\n");
420: xml.append(" <Value>").append(
421: String.valueOf(objphpbb_forumsBean.forum_order))
422: .append("</Value>\n");
423: xml.append(" </Column>\n");
424: xml.append(" <Column>\n");
425: xml.append(" <Name>forum_posts</Name>\n");
426: xml.append(" <Value>").append(
427: String.valueOf(objphpbb_forumsBean.forum_posts))
428: .append("</Value>\n");
429: xml.append(" </Column>\n");
430: xml.append(" <Column>\n");
431: xml.append(" <Name>forum_topics</Name>\n");
432: xml.append(" <Value>").append(
433: String.valueOf(objphpbb_forumsBean.forum_topics))
434: .append("</Value>\n");
435: xml.append(" </Column>\n");
436: xml.append(" <Column>\n");
437: xml.append(" <Name>forum_last_post_id</Name>\n");
438: xml
439: .append(" <Value>")
440: .append(
441: String
442: .valueOf(objphpbb_forumsBean.forum_last_post_id))
443: .append("</Value>\n");
444: xml.append(" </Column>\n");
445: xml.append(" <Column>\n");
446: xml.append(" <Name>prune_next</Name>\n");
447: xml.append(" <Value>").append(
448: String.valueOf(objphpbb_forumsBean.prune_next))
449: .append("</Value>\n");
450: xml.append(" </Column>\n");
451: xml.append(" <Column>\n");
452: xml.append(" <Name>prune_enable</Name>\n");
453: xml.append(" <Value>").append(
454: String.valueOf(objphpbb_forumsBean.prune_enable))
455: .append("</Value>\n");
456: xml.append(" </Column>\n");
457: xml.append(" <Column>\n");
458: xml.append(" <Name>auth_view</Name>\n");
459: xml.append(" <Value>").append(
460: String.valueOf(objphpbb_forumsBean.auth_view))
461: .append("</Value>\n");
462: xml.append(" </Column>\n");
463: xml.append(" <Column>\n");
464: xml.append(" <Name>auth_read</Name>\n");
465: xml.append(" <Value>").append(
466: String.valueOf(objphpbb_forumsBean.auth_read))
467: .append("</Value>\n");
468: xml.append(" </Column>\n");
469: xml.append(" <Column>\n");
470: xml.append(" <Name>auth_post</Name>\n");
471: xml.append(" <Value>").append(
472: String.valueOf(objphpbb_forumsBean.auth_post))
473: .append("</Value>\n");
474: xml.append(" </Column>\n");
475: xml.append(" <Column>\n");
476: xml.append(" <Name>auth_reply</Name>\n");
477: xml.append(" <Value>").append(
478: String.valueOf(objphpbb_forumsBean.auth_reply))
479: .append("</Value>\n");
480: xml.append(" </Column>\n");
481: xml.append(" <Column>\n");
482: xml.append(" <Name>auth_edit</Name>\n");
483: xml.append(" <Value>").append(
484: String.valueOf(objphpbb_forumsBean.auth_edit))
485: .append("</Value>\n");
486: xml.append(" </Column>\n");
487: xml.append(" <Column>\n");
488: xml.append(" <Name>auth_delete</Name>\n");
489: xml.append(" <Value>").append(
490: String.valueOf(objphpbb_forumsBean.auth_delete))
491: .append("</Value>\n");
492: xml.append(" </Column>\n");
493: xml.append(" <Column>\n");
494: xml.append(" <Name>auth_sticky</Name>\n");
495: xml.append(" <Value>").append(
496: String.valueOf(objphpbb_forumsBean.auth_sticky))
497: .append("</Value>\n");
498: xml.append(" </Column>\n");
499: xml.append(" <Column>\n");
500: xml.append(" <Name>auth_announce</Name>\n");
501: xml.append(" <Value>").append(
502: String.valueOf(objphpbb_forumsBean.auth_announce))
503: .append("</Value>\n");
504: xml.append(" </Column>\n");
505: xml.append(" <Column>\n");
506: xml.append(" <Name>auth_vote</Name>\n");
507: xml.append(" <Value>").append(
508: String.valueOf(objphpbb_forumsBean.auth_vote))
509: .append("</Value>\n");
510: xml.append(" </Column>\n");
511: xml.append(" <Column>\n");
512: xml.append(" <Name>auth_pollcreate</Name>\n");
513: xml
514: .append(" <Value>")
515: .append(
516: String
517: .valueOf(objphpbb_forumsBean.auth_pollcreate))
518: .append("</Value>\n");
519: xml.append(" </Column>\n");
520: xml.append(" <Column>\n");
521: xml.append(" <Name>auth_attachments</Name>\n");
522: xml
523: .append(" <Value>")
524: .append(
525: String
526: .valueOf(objphpbb_forumsBean.auth_attachments))
527: .append("</Value>\n");
528: xml.append(" </Column>\n");
529: xml.append(" </Row>\n");
530: }//while
531: xml.append(" </Rows>\n");
532: xml.append("</phpbb_forumsSection>\n");
533: return xml.toString();
534: }
535: } //end of class phpbb_forumsBean
|