PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/mvnforum-1.2.2-ga/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/PhpbbTopics.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 287 lines | 224 code | 17 blank | 46 comment | 1 complexity | 0468611b367f01987089d35effd27d9e MD5 | raw file
  1. /*
  2. * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/PhpbbTopics.java,v 1.3 2007/01/15 10:27:33 dungbtm Exp $
  3. * $Author: dungbtm $
  4. * $Revision: 1.3 $
  5. * $Date: 2007/01/15 10:27:33 $
  6. *
  7. * ====================================================================
  8. *
  9. * Copyright (C) 2002-2007 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:
  39. */
  40. package org.mvnforum.phpbb2mvnforum.db;
  41. //import java.sql.*; // @todo: uncomment as needed
  42. import java.util.Collection;//for xml support
  43. import java.util.Iterator;//for xml support
  44. /*
  45. * Included columns: topic_id, forum_id, topic_title, topic_poster, topic_time,
  46. * topic_views, topic_replies, topic_status, topic_vote, topic_type,
  47. * topic_first_post_id, topic_last_post_id, topic_moved_id
  48. * Excluded columns:
  49. */
  50. public class PhpbbTopics {
  51. private int topic_id;
  52. private int forum_id;
  53. private String topic_title;
  54. private int topic_poster;
  55. private int topic_time;
  56. private int topic_views;
  57. private int topic_replies;
  58. private int topic_status;
  59. private int topic_vote;
  60. private int topic_type;
  61. private int topic_first_post_id;
  62. private int topic_last_post_id;
  63. private int topic_moved_id;
  64. public int gettopic_id() {
  65. return topic_id;
  66. }
  67. public void settopic_id(int topic_id) {
  68. this.topic_id = topic_id;
  69. }
  70. public int getforum_id() {
  71. return forum_id;
  72. }
  73. public void setforum_id(int forum_id) {
  74. this.forum_id = forum_id;
  75. }
  76. public String gettopic_title() {
  77. return topic_title;
  78. }
  79. public void settopic_title(String topic_title) {
  80. this.topic_title = topic_title;
  81. }
  82. public int gettopic_poster() {
  83. return topic_poster;
  84. }
  85. public void settopic_poster(int topic_poster) {
  86. this.topic_poster = topic_poster;
  87. }
  88. public int gettopic_time() {
  89. return topic_time;
  90. }
  91. public void settopic_time(int topic_time) {
  92. this.topic_time = topic_time;
  93. }
  94. public int gettopic_views() {
  95. return topic_views;
  96. }
  97. public void settopic_views(int topic_views) {
  98. this.topic_views = topic_views;
  99. }
  100. public int gettopic_replies() {
  101. return topic_replies;
  102. }
  103. public void settopic_replies(int topic_replies) {
  104. this.topic_replies = topic_replies;
  105. }
  106. public int gettopic_status() {
  107. return topic_status;
  108. }
  109. public void settopic_status(int topic_status) {
  110. this.topic_status = topic_status;
  111. }
  112. public int gettopic_vote() {
  113. return topic_vote;
  114. }
  115. public void settopic_vote(int topic_vote) {
  116. this.topic_vote = topic_vote;
  117. }
  118. public int gettopic_type() {
  119. return topic_type;
  120. }
  121. public void settopic_type(int topic_type) {
  122. this.topic_type = topic_type;
  123. }
  124. public int gettopic_first_post_id() {
  125. return topic_first_post_id;
  126. }
  127. public void settopic_first_post_id(int topic_first_post_id) {
  128. this.topic_first_post_id = topic_first_post_id;
  129. }
  130. public int gettopic_last_post_id() {
  131. return topic_last_post_id;
  132. }
  133. public void settopic_last_post_id(int topic_last_post_id) {
  134. this.topic_last_post_id = topic_last_post_id;
  135. }
  136. public int gettopic_moved_id() {
  137. return topic_moved_id;
  138. }
  139. public void settopic_moved_id(int topic_moved_id) {
  140. this.topic_moved_id = topic_moved_id;
  141. }
  142. public String getXML() {
  143. StringBuffer xml = new StringBuffer(1024);
  144. xml.append("<phpbb_topicsSection>\n");
  145. xml.append(" <Rows>\n");
  146. xml.append(" <Row>\n");
  147. xml.append(" <Column>\n");
  148. xml.append(" <Name>topic_id</Name>\n");
  149. xml.append(" <Value>").append(String.valueOf(topic_id)).append("</Value>\n");
  150. xml.append(" </Column>\n");
  151. xml.append(" <Column>\n");
  152. xml.append(" <Name>forum_id</Name>\n");
  153. xml.append(" <Value>").append(String.valueOf(forum_id)).append("</Value>\n");
  154. xml.append(" </Column>\n");
  155. xml.append(" <Column>\n");
  156. xml.append(" <Name>topic_title</Name>\n");
  157. xml.append(" <Value>").append(String.valueOf(topic_title)).append("</Value>\n");
  158. xml.append(" </Column>\n");
  159. xml.append(" <Column>\n");
  160. xml.append(" <Name>topic_poster</Name>\n");
  161. xml.append(" <Value>").append(String.valueOf(topic_poster)).append("</Value>\n");
  162. xml.append(" </Column>\n");
  163. xml.append(" <Column>\n");
  164. xml.append(" <Name>topic_time</Name>\n");
  165. xml.append(" <Value>").append(String.valueOf(topic_time)).append("</Value>\n");
  166. xml.append(" </Column>\n");
  167. xml.append(" <Column>\n");
  168. xml.append(" <Name>topic_views</Name>\n");
  169. xml.append(" <Value>").append(String.valueOf(topic_views)).append("</Value>\n");
  170. xml.append(" </Column>\n");
  171. xml.append(" <Column>\n");
  172. xml.append(" <Name>topic_replies</Name>\n");
  173. xml.append(" <Value>").append(String.valueOf(topic_replies)).append("</Value>\n");
  174. xml.append(" </Column>\n");
  175. xml.append(" <Column>\n");
  176. xml.append(" <Name>topic_status</Name>\n");
  177. xml.append(" <Value>").append(String.valueOf(topic_status)).append("</Value>\n");
  178. xml.append(" </Column>\n");
  179. xml.append(" <Column>\n");
  180. xml.append(" <Name>topic_vote</Name>\n");
  181. xml.append(" <Value>").append(String.valueOf(topic_vote)).append("</Value>\n");
  182. xml.append(" </Column>\n");
  183. xml.append(" <Column>\n");
  184. xml.append(" <Name>topic_type</Name>\n");
  185. xml.append(" <Value>").append(String.valueOf(topic_type)).append("</Value>\n");
  186. xml.append(" </Column>\n");
  187. xml.append(" <Column>\n");
  188. xml.append(" <Name>topic_first_post_id</Name>\n");
  189. xml.append(" <Value>").append(String.valueOf(topic_first_post_id)).append("</Value>\n");
  190. xml.append(" </Column>\n");
  191. xml.append(" <Column>\n");
  192. xml.append(" <Name>topic_last_post_id</Name>\n");
  193. xml.append(" <Value>").append(String.valueOf(topic_last_post_id)).append("</Value>\n");
  194. xml.append(" </Column>\n");
  195. xml.append(" <Column>\n");
  196. xml.append(" <Name>topic_moved_id</Name>\n");
  197. xml.append(" <Value>").append(String.valueOf(topic_moved_id)).append("</Value>\n");
  198. xml.append(" </Column>\n");
  199. xml.append(" </Row>\n");
  200. xml.append(" </Rows>\n");
  201. xml.append("</phpbb_topicsSection>\n");
  202. return xml.toString();
  203. }
  204. public static String getXML(Collection objphpbb_topicsBeans) {
  205. StringBuffer xml = new StringBuffer(1024);
  206. Iterator iterator = objphpbb_topicsBeans.iterator();
  207. xml.append("<phpbb_topicsSection>\n");
  208. xml.append(" <Rows>\n");
  209. while (iterator.hasNext()) {
  210. PhpbbTopics objphpbb_topicsBean = (PhpbbTopics)iterator.next();
  211. xml.append(" <Row>\n");
  212. xml.append(" <Column>\n");
  213. xml.append(" <Name>topic_id</Name>\n");
  214. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_id)).append("</Value>\n");
  215. xml.append(" </Column>\n");
  216. xml.append(" <Column>\n");
  217. xml.append(" <Name>forum_id</Name>\n");
  218. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.forum_id)).append("</Value>\n");
  219. xml.append(" </Column>\n");
  220. xml.append(" <Column>\n");
  221. xml.append(" <Name>topic_title</Name>\n");
  222. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_title)).append("</Value>\n");
  223. xml.append(" </Column>\n");
  224. xml.append(" <Column>\n");
  225. xml.append(" <Name>topic_poster</Name>\n");
  226. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_poster)).append("</Value>\n");
  227. xml.append(" </Column>\n");
  228. xml.append(" <Column>\n");
  229. xml.append(" <Name>topic_time</Name>\n");
  230. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_time)).append("</Value>\n");
  231. xml.append(" </Column>\n");
  232. xml.append(" <Column>\n");
  233. xml.append(" <Name>topic_views</Name>\n");
  234. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_views)).append("</Value>\n");
  235. xml.append(" </Column>\n");
  236. xml.append(" <Column>\n");
  237. xml.append(" <Name>topic_replies</Name>\n");
  238. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_replies)).append("</Value>\n");
  239. xml.append(" </Column>\n");
  240. xml.append(" <Column>\n");
  241. xml.append(" <Name>topic_status</Name>\n");
  242. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_status)).append("</Value>\n");
  243. xml.append(" </Column>\n");
  244. xml.append(" <Column>\n");
  245. xml.append(" <Name>topic_vote</Name>\n");
  246. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_vote)).append("</Value>\n");
  247. xml.append(" </Column>\n");
  248. xml.append(" <Column>\n");
  249. xml.append(" <Name>topic_type</Name>\n");
  250. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_type)).append("</Value>\n");
  251. xml.append(" </Column>\n");
  252. xml.append(" <Column>\n");
  253. xml.append(" <Name>topic_first_post_id</Name>\n");
  254. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_first_post_id)).append("</Value>\n");
  255. xml.append(" </Column>\n");
  256. xml.append(" <Column>\n");
  257. xml.append(" <Name>topic_last_post_id</Name>\n");
  258. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_last_post_id)).append("</Value>\n");
  259. xml.append(" </Column>\n");
  260. xml.append(" <Column>\n");
  261. xml.append(" <Name>topic_moved_id</Name>\n");
  262. xml.append(" <Value>").append(String.valueOf(objphpbb_topicsBean.topic_moved_id)).append("</Value>\n");
  263. xml.append(" </Column>\n");
  264. xml.append(" </Row>\n");
  265. }//while
  266. xml.append(" </Rows>\n");
  267. xml.append("</phpbb_topicsSection>\n");
  268. return xml.toString();
  269. }
  270. } //end of class phpbb_topicsBean