1 41 package com.mvnforum.db; 42 43 import java.sql.Timestamp ; 44 import java.util.Collection ; 45 import java.util.Iterator ; 46 47 import net.myvietnam.mvncore.util.StringUtil; 48 49 56 public class CompanyBean { 57 private int companyID; 58 private int groupID; 59 private String companyName; 60 private String companyAddress; 61 private String companyCity; 62 private String companyCAP; 63 private String companyProvince; 64 private String companyRegion; 65 private String companyPhone; 66 private String companyFax; 67 private String companyWebsite; 68 private String companyEmail; 69 private String companySpaceName; 70 private String companySpaceHeader; 71 private String companySpaceFooter; 72 private String companyVATNumber; 73 private String companyLogo; 74 private String companyCss; 75 private Timestamp companyCreationDate; 76 private Timestamp companyModifiedDate; 77 78 public int getCompanyID() { 79 return companyID; 80 } 81 public void setCompanyID(int companyID) { 82 this.companyID = companyID; 83 } 84 85 public int getGroupID() { 86 return groupID; 87 } 88 public void setGroupID(int groupID) { 89 this.groupID = groupID; 90 } 91 92 public String getCompanyName() { 93 return companyName; 94 } 95 public void setCompanyName(String companyName) { 96 this.companyName = StringUtil.getEmptyStringIfNull(companyName); 97 } 98 99 public String getCompanyAddress() { 100 return companyAddress; 101 } 102 public void setCompanyAddress(String companyAddress) { 103 this.companyAddress = StringUtil.getEmptyStringIfNull(companyAddress); 104 } 105 106 public String getCompanyCity() { 107 return companyCity; 108 } 109 public void setCompanyCity(String companyCity) { 110 this.companyCity = StringUtil.getEmptyStringIfNull(companyCity); 111 } 112 113 public String getCompanyCAP() { 114 return companyCAP; 115 } 116 public void setCompanyCAP(String companyCAP) { 117 this.companyCAP = StringUtil.getEmptyStringIfNull(companyCAP); 118 } 119 120 public String getCompanyProvince() { 121 return companyProvince; 122 } 123 public void setCompanyProvince(String companyProvince) { 124 this.companyProvince = StringUtil.getEmptyStringIfNull(companyProvince); 125 } 126 127 public String getCompanyRegion() { 128 return companyRegion; 129 } 130 public void setCompanyRegion(String companyRegion) { 131 this.companyRegion = StringUtil.getEmptyStringIfNull(companyRegion); 132 } 133 134 public String getCompanyPhone() { 135 return companyPhone; 136 } 137 public void setCompanyPhone(String companyPhone) { 138 this.companyPhone = StringUtil.getEmptyStringIfNull(companyPhone); 139 } 140 141 public String getCompanyFax() { 142 return companyFax; 143 } 144 public void setCompanyFax(String companyFax) { 145 this.companyFax = StringUtil.getEmptyStringIfNull(companyFax); 146 } 147 148 public String getCompanyWebsite() { 149 return companyWebsite; 150 } 151 public void setCompanyWebsite(String companyWebsite) { 152 this.companyWebsite = StringUtil.getEmptyStringIfNull(companyWebsite); 153 } 154 155 public String getCompanyEmail() { 156 return companyEmail; 157 } 158 public void setCompanyEmail(String companyEmail) { 159 this.companyEmail = StringUtil.getEmptyStringIfNull(companyEmail); 160 } 161 162 public String getCompanySpaceName() { 163 return companySpaceName; 164 } 165 public void setCompanySpaceName(String companySpaceName) { 166 this.companySpaceName = StringUtil.getEmptyStringIfNull(companySpaceName); 167 } 168 169 public String getCompanySpaceHeader() { 170 return companySpaceHeader; 171 } 172 public void setCompanySpaceHeader(String companySpaceHeader) { 173 this.companySpaceHeader = StringUtil.getEmptyStringIfNull(companySpaceHeader); 174 } 175 176 public String getCompanySpaceFooter() { 177 return companySpaceFooter; 178 } 179 public void setCompanySpaceFooter(String companySpaceFooter) { 180 this.companySpaceFooter = StringUtil.getEmptyStringIfNull(companySpaceFooter); 181 } 182 183 public String getCompanyVATNumber() { 184 return companyVATNumber; 185 } 186 public void setCompanyVATNumber(String companyVATNumber) { 187 this.companyVATNumber = StringUtil.getEmptyStringIfNull(companyVATNumber); 188 } 189 190 public String getCompanyLogo() { 191 return companyLogo; 192 } 193 public void setCompanyLogo(String companyLogo) { 194 this.companyLogo = StringUtil.getEmptyStringIfNull(companyLogo); 195 } 196 197 public String getCompanyCss() { 198 return companyCss; 199 } 200 public void setCompanyCss(String companyCss) { 201 this.companyCss = StringUtil.getEmptyStringIfNull(companyCss); 202 } 203 204 public Timestamp getCompanyCreationDate() { 205 return companyCreationDate; 206 } 207 public void setCompanyCreationDate(Timestamp companyCreationDate) { 208 this.companyCreationDate = companyCreationDate; 209 } 210 211 public Timestamp getCompanyModifiedDate() { 212 return companyModifiedDate; 213 } 214 public void setCompanyModifiedDate(Timestamp companyModifiedDate) { 215 this.companyModifiedDate = companyModifiedDate; 216 } 217 218 public String getXML() { 219 StringBuffer xml = new StringBuffer (1024); 220 xml.append("<CompanySection>\n"); 221 xml.append(" <Rows>\n"); 222 xml.append(" <Row>\n"); 223 xml.append(" <Column>\n"); 224 xml.append(" <Name>CompanyID</Name>\n"); 225 xml.append(" <Value>").append(String.valueOf(companyID)).append("</Value>\n"); 226 xml.append(" </Column>\n"); 227 xml.append(" <Column>\n"); 228 xml.append(" <Name>GroupID</Name>\n"); 229 xml.append(" <Value>").append(String.valueOf(groupID)).append("</Value>\n"); 230 xml.append(" </Column>\n"); 231 xml.append(" <Column>\n"); 232 xml.append(" <Name>CompanyName</Name>\n"); 233 xml.append(" <Value>").append(String.valueOf(companyName)).append("</Value>\n"); 234 xml.append(" </Column>\n"); 235 xml.append(" <Column>\n"); 236 xml.append(" <Name>CompanyAddress</Name>\n"); 237 xml.append(" <Value>").append(String.valueOf(companyAddress)).append("</Value>\n"); 238 xml.append(" </Column>\n"); 239 xml.append(" <Column>\n"); 240 xml.append(" <Name>CompanyCity</Name>\n"); 241 xml.append(" <Value>").append(String.valueOf(companyCity)).append("</Value>\n"); 242 xml.append(" </Column>\n"); 243 xml.append(" <Column>\n"); 244 xml.append(" <Name>CompanyCAP</Name>\n"); 245 xml.append(" <Value>").append(String.valueOf(companyCAP)).append("</Value>\n"); 246 xml.append(" </Column>\n"); 247 xml.append(" <Column>\n"); 248 xml.append(" <Name>CompanyProvince</Name>\n"); 249 xml.append(" <Value>").append(String.valueOf(companyProvince)).append("</Value>\n"); 250 xml.append(" </Column>\n"); 251 xml.append(" <Column>\n"); 252 xml.append(" <Name>CompanyRegion</Name>\n"); 253 xml.append(" <Value>").append(String.valueOf(companyRegion)).append("</Value>\n"); 254 xml.append(" </Column>\n"); 255 xml.append(" <Column>\n"); 256 xml.append(" <Name>CompanyPhone</Name>\n"); 257 xml.append(" <Value>").append(String.valueOf(companyPhone)).append("</Value>\n"); 258 xml.append(" </Column>\n"); 259 xml.append(" <Column>\n"); 260 xml.append(" <Name>CompanyFax</Name>\n"); 261 xml.append(" <Value>").append(String.valueOf(companyFax)).append("</Value>\n"); 262 xml.append(" </Column>\n"); 263 xml.append(" <Column>\n"); 264 xml.append(" <Name>CompanyWebsite</Name>\n"); 265 xml.append(" <Value>").append(String.valueOf(companyWebsite)).append("</Value>\n"); 266 xml.append(" </Column>\n"); 267 xml.append(" <Column>\n"); 268 xml.append(" <Name>CompanyEmail</Name>\n"); 269 xml.append(" <Value>").append(String.valueOf(companyEmail)).append("</Value>\n"); 270 xml.append(" </Column>\n"); 271 xml.append(" <Column>\n"); 272 xml.append(" <Name>CompanySpaceName</Name>\n"); 273 xml.append(" <Value>").append(String.valueOf(companySpaceName)).append("</Value>\n"); 274 xml.append(" </Column>\n"); 275 xml.append(" <Column>\n"); 276 xml.append(" <Name>CompanySpaceHeader</Name>\n"); 277 xml.append(" <Value>").append(String.valueOf(companySpaceHeader)).append("</Value>\n"); 278 xml.append(" </Column>\n"); 279 xml.append(" <Column>\n"); 280 xml.append(" <Name>CompanySpaceFooter</Name>\n"); 281 xml.append(" <Value>").append(String.valueOf(companySpaceFooter)).append("</Value>\n"); 282 xml.append(" </Column>\n"); 283 xml.append(" <Column>\n"); 284 xml.append(" <Name>CompanyVATNumber</Name>\n"); 285 xml.append(" <Value>").append(String.valueOf(companyVATNumber)).append("</Value>\n"); 286 xml.append(" </Column>\n"); 287 xml.append(" <Column>\n"); 288 xml.append(" <Name>CompanyLogo</Name>\n"); 289 xml.append(" <Value>").append(String.valueOf(companyLogo)).append("</Value>\n"); 290 xml.append(" </Column>\n"); 291 xml.append(" <Column>\n"); 292 xml.append(" <Name>CompanyCss</Name>\n"); 293 xml.append(" <Value>").append(String.valueOf(companyCss)).append("</Value>\n"); 294 xml.append(" </Column>\n"); 295 xml.append(" <Column>\n"); 296 xml.append(" <Name>CompanyCreationDate</Name>\n"); 297 xml.append(" <Value>").append(String.valueOf(companyCreationDate)).append("</Value>\n"); 298 xml.append(" </Column>\n"); 299 xml.append(" <Column>\n"); 300 xml.append(" <Name>CompanyModifiedDate</Name>\n"); 301 xml.append(" <Value>").append(String.valueOf(companyModifiedDate)).append("</Value>\n"); 302 xml.append(" </Column>\n"); 303 xml.append(" </Row>\n"); 304 xml.append(" </Rows>\n"); 305 xml.append("</CompanySection>\n"); 306 return xml.toString(); 307 } 308 309 public static String getXML(Collection objCompanyBeans) { 310 StringBuffer xml = new StringBuffer (1024); 311 Iterator iterator = objCompanyBeans.iterator(); 312 xml.append("<CompanySection>\n"); 313 xml.append(" <Rows>\n"); 314 while (iterator.hasNext()) { 315 CompanyBean objCompanyBean = (CompanyBean)iterator.next(); 316 xml.append(" <Row>\n"); 317 xml.append(" <Column>\n"); 318 xml.append(" <Name>CompanyID</Name>\n"); 319 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyID)).append("</Value>\n"); 320 xml.append(" </Column>\n"); 321 xml.append(" <Column>\n"); 322 xml.append(" <Name>GroupID</Name>\n"); 323 xml.append(" <Value>").append(String.valueOf(objCompanyBean.groupID)).append("</Value>\n"); 324 xml.append(" </Column>\n"); 325 xml.append(" <Column>\n"); 326 xml.append(" <Name>CompanyName</Name>\n"); 327 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyName)).append("</Value>\n"); 328 xml.append(" </Column>\n"); 329 xml.append(" <Column>\n"); 330 xml.append(" <Name>CompanyAddress</Name>\n"); 331 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyAddress)).append("</Value>\n"); 332 xml.append(" </Column>\n"); 333 xml.append(" <Column>\n"); 334 xml.append(" <Name>CompanyCity</Name>\n"); 335 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCity)).append("</Value>\n"); 336 xml.append(" </Column>\n"); 337 xml.append(" <Column>\n"); 338 xml.append(" <Name>CompanyCAP</Name>\n"); 339 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCAP)).append("</Value>\n"); 340 xml.append(" </Column>\n"); 341 xml.append(" <Column>\n"); 342 xml.append(" <Name>CompanyProvince</Name>\n"); 343 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyProvince)).append("</Value>\n"); 344 xml.append(" </Column>\n"); 345 xml.append(" <Column>\n"); 346 xml.append(" <Name>CompanyRegion</Name>\n"); 347 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyRegion)).append("</Value>\n"); 348 xml.append(" </Column>\n"); 349 xml.append(" <Column>\n"); 350 xml.append(" <Name>CompanyPhone</Name>\n"); 351 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyPhone)).append("</Value>\n"); 352 xml.append(" </Column>\n"); 353 xml.append(" <Column>\n"); 354 xml.append(" <Name>CompanyFax</Name>\n"); 355 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyFax)).append("</Value>\n"); 356 xml.append(" </Column>\n"); 357 xml.append(" <Column>\n"); 358 xml.append(" <Name>CompanyWebsite</Name>\n"); 359 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyWebsite)).append("</Value>\n"); 360 xml.append(" </Column>\n"); 361 xml.append(" <Column>\n"); 362 xml.append(" <Name>CompanyEmail</Name>\n"); 363 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyEmail)).append("</Value>\n"); 364 xml.append(" </Column>\n"); 365 xml.append(" <Column>\n"); 366 xml.append(" <Name>CompanySpaceName</Name>\n"); 367 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceName)).append("</Value>\n"); 368 xml.append(" </Column>\n"); 369 xml.append(" <Column>\n"); 370 xml.append(" <Name>CompanySpaceHeader</Name>\n"); 371 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceHeader)).append("</Value>\n"); 372 xml.append(" </Column>\n"); 373 xml.append(" <Column>\n"); 374 xml.append(" <Name>CompanySpaceFooter</Name>\n"); 375 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companySpaceFooter)).append("</Value>\n"); 376 xml.append(" </Column>\n"); 377 xml.append(" <Column>\n"); 378 xml.append(" <Name>CompanyVATNumber</Name>\n"); 379 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyVATNumber)).append("</Value>\n"); 380 xml.append(" </Column>\n"); 381 xml.append(" <Column>\n"); 382 xml.append(" <Name>CompanyLogo</Name>\n"); 383 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyLogo)).append("</Value>\n"); 384 xml.append(" </Column>\n"); 385 xml.append(" <Column>\n"); 386 xml.append(" <Name>CompanyCss</Name>\n"); 387 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCss)).append("</Value>\n"); 388 xml.append(" </Column>\n"); 389 xml.append(" <Column>\n"); 390 xml.append(" <Name>CompanyCreationDate</Name>\n"); 391 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyCreationDate)).append("</Value>\n"); 392 xml.append(" </Column>\n"); 393 xml.append(" <Column>\n"); 394 xml.append(" <Name>CompanyModifiedDate</Name>\n"); 395 xml.append(" <Value>").append(String.valueOf(objCompanyBean.companyModifiedDate)).append("</Value>\n"); 396 xml.append(" </Column>\n"); 397 xml.append(" </Row>\n"); 398 } xml.append(" </Rows>\n"); 400 xml.append("</CompanySection>\n"); 401 return xml.toString(); 402 } 403 } | Popular Tags |