001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/PhpbbPostText.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.sql.*; // @todo: uncomment as needed
043: import java.util.Collection;//for xml support
044: import java.util.Iterator;//for xml support
045:
046: /*
047: * Included columns: post_id, bbcode_uid, post_subject, post_text
048: * Excluded columns:
049: */
050: public class PhpbbPostText {
051: private int post_id;
052: private String bbcode_uid;
053: private String post_subject;
054: private String post_text;
055:
056: public int getpost_id() {
057: return post_id;
058: }
059:
060: public void setpost_id(int post_id) {
061: this .post_id = post_id;
062: }
063:
064: public String getbbcode_uid() {
065: return bbcode_uid;
066: }
067:
068: public void setbbcode_uid(String bbcode_uid) {
069: this .bbcode_uid = bbcode_uid;
070: }
071:
072: public String getpost_subject() {
073: return post_subject;
074: }
075:
076: public void setpost_subject(String post_subject) {
077: this .post_subject = post_subject;
078: }
079:
080: public String getpost_text() {
081: return post_text;
082: }
083:
084: public void setpost_text(String post_text) {
085: this .post_text = post_text;
086: }
087:
088: public String getXML() {
089: StringBuffer xml = new StringBuffer(1024);
090: xml.append("<phpbb_posts_textSection>\n");
091: xml.append(" <Rows>\n");
092: xml.append(" <Row>\n");
093: xml.append(" <Column>\n");
094: xml.append(" <Name>post_id</Name>\n");
095: xml.append(" <Value>").append(String.valueOf(post_id))
096: .append("</Value>\n");
097: xml.append(" </Column>\n");
098: xml.append(" <Column>\n");
099: xml.append(" <Name>bbcode_uid</Name>\n");
100: xml.append(" <Value>")
101: .append(String.valueOf(bbcode_uid))
102: .append("</Value>\n");
103: xml.append(" </Column>\n");
104: xml.append(" <Column>\n");
105: xml.append(" <Name>post_subject</Name>\n");
106: xml.append(" <Value>").append(
107: String.valueOf(post_subject)).append("</Value>\n");
108: xml.append(" </Column>\n");
109: xml.append(" <Column>\n");
110: xml.append(" <Name>post_text</Name>\n");
111: xml.append(" <Value>").append(String.valueOf(post_text))
112: .append("</Value>\n");
113: xml.append(" </Column>\n");
114: xml.append(" </Row>\n");
115: xml.append(" </Rows>\n");
116: xml.append("</phpbb_posts_textSection>\n");
117: return xml.toString();
118: }
119:
120: public static String getXML(Collection objphpbb_posts_textBeans) {
121: StringBuffer xml = new StringBuffer(1024);
122: Iterator iterator = objphpbb_posts_textBeans.iterator();
123: xml.append("<phpbb_posts_textSection>\n");
124: xml.append(" <Rows>\n");
125: while (iterator.hasNext()) {
126: PhpbbPostText objphpbb_posts_textBean = (PhpbbPostText) iterator
127: .next();
128: xml.append(" <Row>\n");
129: xml.append(" <Column>\n");
130: xml.append(" <Name>post_id</Name>\n");
131: xml.append(" <Value>").append(
132: String.valueOf(objphpbb_posts_textBean.post_id))
133: .append("</Value>\n");
134: xml.append(" </Column>\n");
135: xml.append(" <Column>\n");
136: xml.append(" <Name>bbcode_uid</Name>\n");
137: xml.append(" <Value>").append(
138: String.valueOf(objphpbb_posts_textBean.bbcode_uid))
139: .append("</Value>\n");
140: xml.append(" </Column>\n");
141: xml.append(" <Column>\n");
142: xml.append(" <Name>post_subject</Name>\n");
143: xml
144: .append(" <Value>")
145: .append(
146: String
147: .valueOf(objphpbb_posts_textBean.post_subject))
148: .append("</Value>\n");
149: xml.append(" </Column>\n");
150: xml.append(" <Column>\n");
151: xml.append(" <Name>post_text</Name>\n");
152: xml.append(" <Value>").append(
153: String.valueOf(objphpbb_posts_textBean.post_text))
154: .append("</Value>\n");
155: xml.append(" </Column>\n");
156: xml.append(" </Row>\n");
157: }//while
158: xml.append(" </Rows>\n");
159: xml.append("</phpbb_posts_textSection>\n");
160: return xml.toString();
161: }
162: } //end of class phpbb_posts_textBean
|