1 5 6 package com.raptus.owxv3.modules.base; 7 8 import java.sql.SQLException ; 9 import java.text.*; 10 import java.util.*; 11 12 import com.raptus.owxv3.*; 13 import com.raptus.owxv3.api.*; 14 import com.raptus.owxv3.api.components.*; 15 import com.raptus.owxv3.api.dataxs.*; 16 39 public class BaseObject extends BusinessObject 40 implements ComponentBusinessObject 41 { 42 45 protected NwslistManager nwsList = null; 46 47 50 protected GlobalResources gres = null; 51 52 55 protected boolean previewEnabled = false; 56 57 58 59 62 protected boolean propertiesEnabled = false; 63 64 65 66 69 protected boolean filesEnabled = false; 70 71 72 75 protected int filesCount = 0; 76 77 78 81 protected boolean picturesEnabled = false; 82 83 84 87 protected int picturesCount = 0; 88 89 92 protected boolean linksEnabled = false; 93 94 95 98 protected int linksCount = 0; 99 100 101 105 protected boolean categoriesEnabled=false; 106 107 108 111 protected int categoryItemCount = 0; 112 113 116 protected boolean fieldsEnabled=false; 117 118 119 120 121 124 protected String sortField = null; 125 126 129 protected boolean sortAscending = true; 130 131 132 133 136 protected int entryCount = 0; 137 140 141 public BaseObject(VModule vm, Locale lcle) 142 { 143 super(vm, lcle); 144 145 XMLConfigManager cm = XMLConfigManager.getInstance(); 146 boolean v = vm.isVirtual(); 147 String b = vm.getBaseModule(); 148 gres = new GlobalResources(); 149 150 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=count","value")) 154 { 155 entryCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=count","value"); 156 } 158 else 159 { 160 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=count","value")) 162 { 163 entryCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=count","value"); 164 } 165 else 166 { 167 LoggingManager.log("ParseException while retrieving custom vm properties! (entryCount)" , this); 168 } 169 } 170 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_preview/property?name=enable","value")) 179 { 180 previewEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_preview/property?name=enable","value"); 181 } 182 else 183 { 184 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_preview/property?name=enable","value")) 186 { 187 previewEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_preview/property?name=enable","value"); 188 } 189 else 190 { 191 LoggingManager.log("ParseException while retrieving custom vm properties! (previewEnabled)", this); 192 } 193 } 194 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_entry/property?name=enable","value")) 203 { 204 propertiesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_entry/property?name=enable","value"); 205 } 206 else 207 { 208 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_entry/property?name=enable","value")) 209 { 210 propertiesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_entry/property?name=enable","value"); 211 } 212 else 213 { 214 LoggingManager.log("ParseException while retrieving custom vm properties! (propertiesEnabled)", this); 215 } 216 } 217 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=enable","value")) 227 { 228 fieldsEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=enable","value"); 229 } 230 else 231 { 232 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_fields/property?name=enable","value")) 233 { 234 fieldsEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_fields/property?name=enable","value"); 235 } 236 else 237 { 238 LoggingManager.log("ParseException while retrieving custom vm properties! (fieldsEnabled)", this); 239 } 240 } 241 247 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_files/property?name=enable","value")) 251 { 252 filesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_files/property?name=enable","value"); 253 } 254 else 255 { 256 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_files/property?name=enable","value")) 257 { 258 filesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_files/property?name=enable","value"); 259 } 260 else 261 { 262 LoggingManager.log("ParseException while retrieving custom vm properties! (filesEnabled)", this); 263 } 264 } 265 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_files/property?name=count","value")) 273 { 274 filesCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_files/property?name=count","value"); 275 } 276 else 277 { 278 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_files/property?name=count","value")) 279 { 280 filesCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_files/property?name=count","value"); 281 } 282 else 283 { 284 LoggingManager.log("ParseException while retrieving custom vm properties! (filesCount)", this); 285 } 286 } 287 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_pics/property?name=enable","value")) 295 { 296 picturesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_pics/property?name=enable","value"); 297 } 298 else 299 { 300 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_pics/property?name=enable","value")) 301 { 302 picturesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_pics/property?name=enable","value"); 303 } 304 else 305 { 306 LoggingManager.log("ParseException while retrieving custom vm properties! (picturesEnabled)", this); 307 } 308 } 309 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_pics/property?name=count","value")) 317 { 318 picturesCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_pics/property?name=count","value"); 319 } 320 else 321 { 322 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_pics/property?name=count","value")) 323 { 324 picturesCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_pics/property?name=count","value"); 325 } 326 else 327 { 328 LoggingManager.log("ParseException while retrieving custom vm properties! (picturesCount)", this); 329 } 330 } 331 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_links/property?name=enable","value")) 339 { 340 linksEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_links/property?name=enable","value"); 341 } 342 else 343 { 344 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_links/property?name=enable","value")) 345 { 346 linksEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_links/property?name=enable","value"); 347 } 348 else 349 { 350 LoggingManager.log("ParseException while retrieving custom vm properties! (linksEnabled)", this); 351 } 352 } 353 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_links/property?name=count","value")) 361 { 362 linksCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_links/property?name=count","value"); 363 } 364 else 365 { 366 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_links/property?name=count","value")) 367 { 368 linksCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_links/property?name=count","value"); 369 } 370 else 371 { 372 LoggingManager.log("ParseException while retrieving custom vm properties! (linksCount)", this); 373 } 374 } 375 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_categories/property?name=enable","value")) 383 { 384 categoriesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_categories/property?name=enable","value"); 385 } 386 else 387 { 388 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_categories/property?name=enable","value")) 389 { 390 categoriesEnabled = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_categories/property?name=enable","value"); 391 } 392 else 393 { 394 LoggingManager.log("ParseException while retrieving custom vm properties! (categoriesEnabled)", this); 395 } 396 } 397 399 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_categories/property?name=count","value")) 406 { 407 categoryItemCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/component-properties/component-property?for=fc_categories/property?name=count","value"); 408 } 409 else 410 { 411 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_categories/property?name=count","value")) 412 { 413 categoryItemCount = cm.getIntegerByTree("virtualhost/vmodules/vmodule?name="+b+"/component-properties/component-property?for=fc_categories/property?name=count","value"); 414 } 415 else 416 { 417 LoggingManager.log("ParseException while retrieving custom vm properties! (categoryItemCount)", this); 418 } 419 } 420 425 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=sort/property?name=field","value")) 427 { 428 sortField = cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=sort/property?name=field","value"); 429 } 430 else 431 { 432 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=sort/property?name=field","value")) 433 { 434 sortField = cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=sort/property?name=field","value"); 435 } 436 } 441 if(cm.existProperty("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=sort/property?name=ascending","value")) 445 { 446 sortAscending = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vm.getIdentification()+"/properties/property?name=sort/property?name=ascending","value"); 447 } 448 else 449 { 450 if(v && cm.existProperty("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=sort/property?name=ascending","value")) 451 { 452 sortAscending = cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+b+"/properties/property?name=sort/property?name=ascending","value"); 453 } 454 else 455 { 456 LoggingManager.log("ParseException while retrieving custom vm properties! (sortAscending)", this); 457 } 458 } 459 464 if(sortField == null) 465 sortField = "entrydte"; 466 467 } 468 469 public PubBaseEntry loadById(int id) 470 { 471 nwsList = new NwslistManager(vmodule.getIdentification()); 472 nwsList.setDataSource(vmodule.getDatasource()); 473 474 String table = nwsList.getTableID(); 475 try 476 { 477 Nwslist entry = nwsList.loadByKey(id); 478 479 if( entry==null) return null; 480 481 482 PubBaseEntry pne = new PubBaseEntry(); 483 if(entry.getFlagentrydte()) 484 pne.setEntryDate( getLocaleFormattedDate(entry.getEntrydte()) ); 485 486 489 pne.setFieldList( gres.loadFields(table,entry.getRowid()) ); 490 pne.setLocalizedFieldList( gres.loadLocalizedFields(table, entry.getRowid()) ); 491 492 if(linksEnabled && entry.getFlaglinks()) 493 pne.setLinkList( gres.loadURLsAndTitles(table, entry.getRowid(), BaseConstants.RESURLFIELD_URL,locale) ); 494 495 if(filesEnabled && entry.getFlagfiles()) 496 pne.setFilesList( gres.loadLinkedFilesAndTitles(GlobalResources.FILETYPE_FILE, 497 table, entry.getRowid(), BaseConstants.RESFILEFIELD_FILE, BaseConstants.RESFILEFIELD_LINK,locale) ); 498 499 if(picturesEnabled && entry.getFlagpictures()) 500 pne.setPicList( gres.loadLinkedFilesAndTitles(GlobalResources.FILETYPE_PICTURE, 501 table, entry.getRowid(), BaseConstants.RESPICFIELD_PIC,BaseConstants.RESPICFIELD_LINK,locale) ); 502 503 return pne; 504 } 505 catch(SQLException e) { 506 LoggingManager.log("SQLException during retrieval of pub news entry! " + e.getMessage(), this); 507 return null; 508 } 509 } 510 511 514 public Vector loadPubBaseListEntries(CategoryFilter filter) 515 { 516 Vector newsPubList = null; 517 nwsList = new NwslistManager(vmodule.getIdentification()); 518 nwsList.setDataSource(vmodule.getDatasource()); 519 String filt=""; 520 if(filter != null) 521 { 522 Vector v = filter.getIDs(); 523 if(v.size()>0) 524 { 525 filt="("; 526 int _i; 527 for(_i=0;_i<v.size()-1;_i++) 528 { 529 Integer ii = (Integer )v.elementAt(_i); 530 filt = filt+" rowid='"+ii.intValue()+"' or "; 531 } 532 Integer ii = (Integer )v.elementAt(_i); 533 filt = filt+" rowid='"+ii.intValue()+"') AND"; 534 } 535 else 536 { 537 filt="(rowid=0) AND"; 539 } 540 } 541 else 542 { 543 } 545 546 String table = nwsList.getTableID(); 547 try 548 { 549 String where = filt+" flagVisible = true AND (flagtimedpub = false OR (flagtimedpub = true AND " + 551 "( (showfrom = null OR showfrom<=now()) AND (showuntil = null OR showuntil > now()))) )"; 552 553 554 Nwslist[] list = nwsList.loadByWhere(where, sortField + ((sortAscending) ? " ASC" : " DESC"), 0); 555 556 newsPubList = new Vector(list.length); boolean entry_valid=true; 558 for(int i = 0; i < list.length; i ++) 559 { 560 Nwslist entry = list[i]; 561 entry_valid=true; 562 PubBaseEntry pne = new PubBaseEntry(); 563 pne.setBaseID(entry.getRowid()); 564 565 566 if(entry.getFlagentrydte()) 567 pne.setEntryDate( getLocaleFormattedDate(entry.getEntrydte()) ); 568 569 pne.setFieldList( gres.loadFields(table,entry.getRowid()) ); 570 pne.setLocalizedFieldList( gres.loadLocalizedFields(table, entry.getRowid()) ); 571 572 if(linksEnabled && entry.getFlaglinks()) 573 pne.setLinkList( gres.loadURLsAndTitles(table, entry.getRowid(), BaseConstants.RESURLFIELD_URL,locale) ); 574 575 if(filesEnabled && entry.getFlagfiles()) 576 pne.setFilesList( gres.loadLinkedFilesAndTitles(GlobalResources.FILETYPE_FILE, 577 table, entry.getRowid(), BaseConstants.RESFILEFIELD_FILE,BaseConstants.RESFILEFIELD_LINK,locale) ); 578 579 if(picturesEnabled && entry.getFlagpictures()) 580 pne.setPicList( gres.loadLinkedFilesAndTitles(GlobalResources.FILETYPE_PICTURE, 581 table, entry.getRowid(), BaseConstants.RESPICFIELD_PIC,BaseConstants.RESPICFIELD_LINK,locale) ); 582 583 newsPubList.addElement(pne); 585 } 586 } 587 catch(SQLException e) { 588 LoggingManager.log("SQLException during retrieval of pub news list! " + e.getMessage(), this); 589 } 590 591 nwsList = null; 592 return newsPubList; 593 } 594 595 598 public Vector loadEABaseListEntries() 599 { 600 XMLConfigManager cm = XMLConfigManager.getInstance(); 601 602 Vector newsEAList = null; 603 nwsList = new NwslistManager(vmodule.getIdentification()); 604 nwsList.setDataSource(vmodule.getDatasource()); 605 606 String table = nwsList.getTableID(); 607 try 608 { 609 String where = "flagVisible = false OR flagVisible = true"; 611 Nwslist[] list = nwsList.loadByWhere(where, "entrydte DESC", 0); 612 613 newsEAList = new Vector(list.length); String title=cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=titlefield","value"); 616 for(int i = 0; i < list.length; i ++) 618 { 619 Nwslist entry = list[i]; 620 621 EABaseListEntry eae = new EABaseListEntry(); 622 623 eae.setRowId(entry.getRowid()); 624 eae.setFlagVisible(entry.getFlagvisible()); 625 eae.setFlagEntryDte(entry.getFlagentrydte()); 626 eae.setFlagTimedPub(entry.getFlagtimedpub()); 627 628 eae.setFlagFiles(filesEnabled && entry.getFlagfiles()); 629 eae.setFlagLinks(linksEnabled && entry.getFlaglinks()); 630 eae.setFlagPics(picturesEnabled && entry.getFlagpictures()); 631 632 eae.setEntryDte( getLocaleFormattedDate(entry.getEntrydte()) ); 633 634 eae.setTitle( gres.loadField(table, entry.getRowid(), title, locale) ); 635 newsEAList.insertElementAt(eae, 0); } 638 } 639 catch(SQLException e) { 640 LoggingManager.log("SQLException during retrieval of eAdmin news list! " + e.getMessage(), this); 641 } 642 643 nwsList = null; 644 return newsEAList; 646 } 647 648 651 public Vector loadEABaseListEntries(CategoryFilter filter) 652 { 653 Vector newsEAList = null; 654 nwsList = new NwslistManager(vmodule.getIdentification()); 655 nwsList.setDataSource(vmodule.getDatasource()); 656 657 String filt=""; 658 if(filter != null) 659 { 660 Vector v = filter.getIDs(); 661 if(v.size()>0) 662 { 663 filt="("; 664 int _i; 665 for(_i=0;_i<v.size()-1;_i++) 666 { 667 Integer ii = (Integer )v.elementAt(_i); 668 filt = filt+" rowid='"+ii.intValue()+"' or "; 669 } 670 Integer ii = (Integer )v.elementAt(_i); 671 filt = filt+" rowid='"+ii.intValue()+"') AND"; 672 } 673 else 674 { 675 filt="(rowid=0) AND"; 677 } 678 } 679 else 680 { 681 } 683 684 String table = nwsList.getTableID(); 685 try 686 { 687 XMLConfigManager cm = XMLConfigManager.getInstance(); 688 String where = filt+" (flagVisible = false OR flagVisible = true)"; 690 Nwslist[] list = nwsList.loadByWhere(where, "entrydte DESC", 0); 692 693 newsEAList = new Vector(list.length); String title=cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=titlefield","value"); 696 for(int i = 0; i < list.length; i ++) 699 { 700 Nwslist entry = list[i]; 701 702 EABaseListEntry eae = new EABaseListEntry(); 703 704 eae.setRowId(entry.getRowid()); 705 eae.setFlagVisible(entry.getFlagvisible()); 706 eae.setFlagEntryDte(entry.getFlagentrydte()); 707 eae.setFlagTimedPub(entry.getFlagtimedpub()); 708 709 eae.setFlagFiles(filesEnabled && entry.getFlagfiles()); 710 eae.setFlagLinks(linksEnabled && entry.getFlaglinks()); 711 eae.setFlagPics(picturesEnabled && entry.getFlagpictures()); 712 713 eae.setEntryDte( getLocaleFormattedDate(entry.getEntrydte()) ); 714 eae.setTitle( gres.loadField(table, entry.getRowid(), title, locale) ); 715 716 newsEAList.insertElementAt(eae, 0); } 718 } 719 catch(SQLException e) { 720 LoggingManager.log("SQLException during retrieval of eAdmin news list! " + e.getMessage(), this); 721 } 722 723 nwsList = null; 724 LoggingManager.log("Loaded " + newsEAList.size() + " filtered list entries from vmodule " + vmodule.getIdentification(), this); 725 return newsEAList; 726 } 727 728 731 public boolean isNewEntryAllowed() 732 { 733 if(entryCount==0) return true; 734 735 try 736 { 737 nwsList = new NwslistManager(vmodule.getIdentification()); 738 nwsList.setDataSource(vmodule.getDatasource()); 739 Nwslist[] list = nwsList.loadAll(); 740 int currententries=list.length; 741 list=null; 742 nwsList=null; 743 if(currententries>=entryCount) return false; 744 }catch(SQLException e){ 745 LoggingManager.log("SQLException during checking the count of entries! " + e.getMessage(), this); 746 return false; 747 } 748 return true; 749 750 } 751 752 753 protected void initFcFieldData(VModule vmodule, ComponentBean cb) 754 { 755 XMLConfigManager cm = XMLConfigManager.getInstance(); 756 try 758 { 759 String [] fieldlist = cm.getStringArrayByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist", "fields"); 761 String [] locales=vmodule.getLocales(); 763 Hashtable h=new Hashtable(); 764 765 if(fieldlist!=null) 766 { 767 int i=0,j=0; 768 for(i=0;i<locales.length;i++) 770 { 771 h.put(locales[i], cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=simplefield/property?name=labels/label?locale="+locales[i],"value")); 774 } 775 ((CmpFieldsBean) cb).setSimpleFieldLabel(h); 776 String title=cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=titlefield", "value"); 778 if(title==null) title=fieldlist[0]; 779 ((CmpFieldsBean) cb).setTitleFieldName(title); 780 781 String defVal=null; 782 Hashtable defMLVal=null; 783 Hashtable labels=null; 784 boolean enabled=true; 785 for(i=0;i<fieldlist.length;i++) 786 { 787 enabled=true; 788 try 789 { 790 enabled=cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i],"enabled"); 792 } 793 catch(Exception e){} 794 795 if(enabled) 796 { 797 FieldDefinition fd=new FieldDefinition(); 799 fd.setName(fieldlist[i]); 800 fd.setType(cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i],"type")); 803 805 defVal=cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i],"default"); 808 if(defVal!=null) 810 { 811 if( fd.getType() == Constants.FIELDTYPE_DATE ) 813 { 814 if(defVal.equalsIgnoreCase(Constants.DATEFIELD_NOW_IDENTIFIER)) 815 { 816 SimpleDateFormat df=(SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT); 817 df.applyPattern(Constants.DEFAULT_DATEPATTERN); 818 defVal=df.format(new java.util.Date ()); 819 } 820 } 821 fd.setDefaultVal(defVal); 822 } 823 else 824 { 825 defMLVal=new Hashtable(); 826 for(j=0;j<locales.length;j++) 828 { 829 String val=cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i]+"/default?locale="+locales[j],"value"); 832 if(val == null) 833 { 834 val=""; 835 } 836 else 837 { 838 if( fd.getType() == Constants.FIELDTYPE_DATE ) 840 { 841 if(val.equalsIgnoreCase(Constants.DATEFIELD_NOW_IDENTIFIER)) 842 { 843 SimpleDateFormat df=(SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT); 844 df.applyPattern(Constants.DEFAULT_DATEPATTERN); 845 val=df.format(new java.util.Date ()); 846 } 847 } 848 } 850 851 defMLVal.put(locales[j], val); 852 } 853 fd.setDefaultVal(defMLVal); 854 855 } 857 labels=new Hashtable(); 859 for(j=0;j<locales.length;j++) 860 { 861 labels.put(locales[j], cm.getPropertyByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i]+"/label?locale="+locales[j],"value")); 864 } 865 fd.setLabel(labels); 866 boolean wysiwyg=false; 868 try 869 { 870 wysiwyg=cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i],"wysiwyg"); 872 873 }catch(Exception e){} 874 fd.setWysiwyg(wysiwyg); 875 876 boolean empty=false; 877 try 878 { 879 empty=cm.getBooleanByTree("virtualhost/vmodules/vmodule?name="+vmodule.getIdentification()+"/component-properties/component-property?for=fc_fields/property?name=fieldlist/field?name="+fieldlist[i],"empty"); 881 }catch(Exception e){} 882 fd.setEmpty(empty); 883 884 ((CmpFieldsBean) cb).addFieldDefinition(fd); 885 } 887 } 889 890 } } 892 catch(Exception e) 893 { 894 LoggingManager.log("Error while loading field defintions from config file:"+e,this); 895 e.printStackTrace(System.out); 896 } 897 } 899 900 903 public boolean loadComponentData(ComponentContainer cc) 904 { 905 nwsList = new NwslistManager(vmodule.getIdentification()); 906 nwsList.setDataSource(vmodule.getDatasource()); 907 908 String table = nwsList.getTableID(); 909 910 OwxurlsManager urlmanager=new OwxurlsManager(); 911 String urltable=urlmanager.getTableID(); 912 urlmanager=null; 913 914 OwxflinksManager filelinksmanager=new OwxflinksManager(); 915 String filelinktable=filelinksmanager.getTableID(); 916 filelinksmanager=null; 917 918 try 919 { 920 Nwslist entry = nwsList.loadByKey(cc.getDataID()); 922 if(entry != null) 923 { 924 if(cc.getComponents()!=null) 926 { 927 Enumeration enuCmps = cc.getComponents().elements(); 928 while(enuCmps.hasMoreElements()) 929 { 930 ComponentBean cb = (ComponentBean) enuCmps.nextElement(); 931 cb.setCurrLocale(locale); 933 934 String cmpID = cb.getData().getID(); 935 if( cmpID.equals(BaseConstants.COMPONENT_ENTRY_ID) ) 936 { 937 ((CmpEntryBean) cb).setEntryDte( getLocaleFormattedDate(entry.getEntrydte()) ); 938 ((CmpEntryBean) cb).setFlagEntryDte(entry.getFlagentrydte()); 939 ((CmpEntryBean) cb).setFlagTimedPub(entry.getFlagtimedpub()); 940 ((CmpEntryBean) cb).setShowFromDate( getLocaleFormattedDate(entry.getShowfrom()) ); 941 ((CmpEntryBean) cb).setShowFromTime( getLocaleFormattedTime(entry.getShowfrom()) ); 942 ((CmpEntryBean) cb).setShowUntilDate( getLocaleFormattedDate(entry.getShowuntil()) ); 943 ((CmpEntryBean) cb).setShowUntilTime( getLocaleFormattedTime(entry.getShowuntil()) ); 944 } 946 else if( cmpID.equals(BaseConstants.COMPONENT_FILES_ID) ) 947 { 948 try 949 { 950 FilesSelector fs = new FilesSelector(gres,vmodule.getLocales(),filelinktable,filesCount); 951 fs.loadLinkedFilesAndIds(gres, table, entry.getRowid(), BaseConstants.RESFILEFIELD_FILE); 952 ((CmpFilesBean) cb).setFilesSelector(fs); 953 954 955 956 } 957 catch(SQLException e) { 958 LoggingManager.log("Cannot initialize the FilesSelector for component " + cmpID, this); 959 } 960 } 961 else if( cmpID.equals(BaseConstants.COMPONENT_PICS_ID) ) 962 { 963 try 964 { 965 PicturesSelector ps = new PicturesSelector(gres,vmodule.getLocales(),filelinktable,picturesCount); 966 ps.loadLinkedPictures(gres, table, entry.getRowid(), BaseConstants.RESPICFIELD_PIC); 967 ((CmpPicsBean) cb).setPicsSelector(ps); 968 } 969 catch(SQLException e) { 970 LoggingManager.log("Cannot initialize the PicturesSelector for component " + cmpID, this); 971 } 972 } 973 else if( cmpID.equals(BaseConstants.COMPONENT_LINKS_ID) ) 974 { 975 LinksSelector ls = new LinksSelector(vmodule.getLocales(),urltable,linksCount); 976 ls.loadLinks(gres, table, entry.getRowid(), BaseConstants.RESURLFIELD_URL); 977 978 979 ((CmpLinksBean) cb).setLinksSelector(ls); 980 981 } 982 else if( cmpID.equals(BaseConstants.COMPONENT_FIELDS_ID) ) 983 { 984 985 FieldsSelector fs = new FieldsSelector(vmodule.getLocales()); 986 fs.loadFields( gres, table, entry.getRowid() ); 987 988 989 ((CmpFieldsBean) cb).setFieldsSelector(fs); 990 991 initFcFieldData(vmodule,cb); 992 993 994 } 995 else if( cmpID.equals(BaseConstants.COMPONENT_CATEGORIES_ID) ) 996 { 997 998 999 CategorySelector cs = new CategorySelector(vmodule.getLocales(),locale,vmodule.getIdentification(),categoryItemCount); 1000 try 1001 { 1002 cs.loadLinkedCategories(table, entry.getRowid(), ""); 1003 }catch(SQLException e) 1004 { 1005 LoggingManager.log("Unable to load categories for item:"+entry.getRowid()+" error: "+e,this); 1006 } 1007 1008 1009 ((CmpCategoryBean) cb).setCategorySelector(cs); 1010 1011 } 1012 } } } } 1018 catch(SQLException e) { 1019 LoggingManager.log("SQLException during retrieval of pub news list! " + e.getMessage(), this); 1020 return false; 1021 } 1022 1023 nwsList = null; 1024 return true; 1026 } 1027 1028 1031 public boolean loadComponentDefaultData(ComponentContainer cc) 1032 { 1033 1034 OwxurlsManager urlmanager=new OwxurlsManager(); 1035 String urltable=urlmanager.getTableID(); 1036 urlmanager=null; 1037 1038 OwxflinksManager filelinksmanager=new OwxflinksManager(); 1039 String filelinktable=filelinksmanager.getTableID(); 1040 filelinksmanager=null; 1041 1042 cc.setDataID(ComponentConstants.COMPONENT_NEW_DATAID); 1044 1045 if(cc.getComponents()!=null) 1047 { 1048 Enumeration enuCmps = cc.getComponents().elements(); 1050 while(enuCmps.hasMoreElements()) 1051 { 1052 ComponentBean cb = (ComponentBean) enuCmps.nextElement(); 1053 cb.setCurrLocale(locale); 1055 String cmpID = cb.getData().getID(); 1056 if( cmpID.equals(BaseConstants.COMPONENT_ENTRY_ID) ) 1058 { 1059 ((CmpEntryBean) cb).setEntryDte( getLocaleFormattedDate( new java.util.Date () ) ); 1060 ((CmpEntryBean) cb).setFlagEntryDte(true); 1061 ((CmpEntryBean) cb).setFlagTimedPub(false); 1062 ((CmpEntryBean) cb).setShowFromDate(""); 1063 ((CmpEntryBean) cb).setShowFromTime(""); 1064 ((CmpEntryBean) cb).setShowUntilDate(""); 1065 ((CmpEntryBean) cb).setShowUntilTime(""); 1066 } 1068 else if( cmpID.equals(BaseConstants.COMPONENT_FILES_ID) ) 1069 { 1070 try 1071 { 1072 ((CmpFilesBean) cb).setFilesSelector( new FilesSelector(gres,vmodule.getLocales(),filelinktable,filesCount) ); 1073 } 1075 catch(SQLException e) { 1076 LoggingManager.log("Cannot initialize the FilesSelector for component " + cmpID, this); 1077 } 1078 } 1079 else if( cmpID.equals(BaseConstants.COMPONENT_PICS_ID) ) 1080 { 1081 try 1082 { 1083 ((CmpPicsBean) cb).setPicsSelector( new PicturesSelector(gres,vmodule.getLocales(),filelinktable,picturesCount) ); 1084 } 1085 catch(SQLException e) { 1086 LoggingManager.log("Cannot initialize the PicturesSelector for component " + cmpID, this); 1087 } 1088 } 1089 else if( cmpID.equals(BaseConstants.COMPONENT_LINKS_ID) ) 1090 { 1091 ((CmpLinksBean) cb).setLinksSelector( new LinksSelector(vmodule.getLocales(),urltable,linksCount) ); 1092 1093 } 1094 else if( cmpID.equals(BaseConstants.COMPONENT_FIELDS_ID) ) 1095 { 1096 FieldsSelector fs = new FieldsSelector(vmodule.getLocales()); 1097 ((CmpFieldsBean) cb).setFieldsSelector(fs); 1098 initFcFieldData(vmodule,cb); 1099 1100 } 1101 else if( cmpID.equals(BaseConstants.COMPONENT_CATEGORIES_ID) ) 1102 { 1103 try 1104 { 1105 ((CmpCategoryBean) cb).setCategorySelector( new CategorySelector(vmodule.getLocales(),locale,vmodule.getIdentification(),categoryItemCount) ); 1106 } 1107 catch(SQLException e) { 1108 LoggingManager.log("Cannot initialize the PicturesSelector for component " + cmpID, this); 1109 } 1110 } 1111 } } 1116 nwsList = null; 1117 return true; 1119 } 1120 1121 1122 1123 1126 public boolean loadPreviewData(ComponentContainer cc, CmpPreviewBean previewbean) 1127 { 1128 Enumeration enuCmps = cc.getComponents().elements(); 1130 while(enuCmps.hasMoreElements()) 1131 { 1132 ComponentBean cb = (ComponentBean) enuCmps.nextElement(); 1133 String cmpID = cb.getData().getID(); 1134 if( cmpID.equals(BaseConstants.COMPONENT_FIELDS_ID) ) 1135 { 1136 1140 previewbean.setLinkedFields( ((CmpFieldsBean) cb).getFieldsSelector().getLinkedFields(locale) ); 1141 1142 } 1143 else if( cmpID.equals(BaseConstants.COMPONENT_FILES_ID) ) 1144 { 1145 previewbean.setLinkedFiles( ((CmpFilesBean) cb).getFilesSelector().getLinkedFiles(locale) ); 1146 } 1147 else if( cmpID.equals(BaseConstants.COMPONENT_PICS_ID) ) 1148 { 1149 previewbean.setLinkedPics( ((CmpPicsBean) cb).getPicsSelector().getLinkedPics(locale) ); 1150 } 1151 else if( cmpID.equals(BaseConstants.COMPONENT_LINKS_ID) ) 1152 { 1153 previewbean.setLinkedUrls( ((CmpLinksBean) cb).getLinksSelector().getLinkList(locale) ); 1154 } 1155 1156 } 1158 return true; 1159 } 1161 1162 1163 1164 1165 1168 public boolean saveComponentData(ComponentContainer cc) 1169 { 1170 nwsList = new NwslistManager(vmodule.getIdentification()); 1172 nwsList.setDataSource(vmodule.getDatasource()); 1173 1174 String table = nwsList.getTableID(); 1175 int dataID = cc.getDataID(); 1176 Nwslist newsEntry = null; 1177 1178 1179 1180 Enumeration enuCmps = cc.getComponents().elements(); 1184 while(enuCmps.hasMoreElements()) 1185 { 1186 ComponentBean cb = (ComponentBean) enuCmps.nextElement(); 1187 1188 String cmpID = cb.getData().getID(); 1189 try 1190 { 1191 if( cmpID.equals(BaseConstants.COMPONENT_ENTRY_ID) ) 1192 { 1193 newsEntry = new Nwslist(); 1194 1195 newsEntry.setFlagentrydte( ((CmpEntryBean) cb).getFlagEntryDte() ); 1197 newsEntry.setFlagtimedpub( ((CmpEntryBean) cb).getFlagTimedPub() ); 1198 newsEntry.setEntrydte( getDateFromStrings( ((CmpEntryBean) cb).getEntryDte(), null ) ); 1199 1200 java.util.Date showFrom = ((CmpEntryBean) cb).getShowFrom(); 1201 if(showFrom != null) newsEntry.setShowfrom(showFrom); 1202 1203 java.util.Date showUntil = ((CmpEntryBean) cb).getShowUntil(); 1204 if(showUntil != null) newsEntry.setShowuntil(showUntil); 1205 1206 if(dataID == ComponentConstants.COMPONENT_NEW_DATAID) 1207 { 1208 newsEntry.setIsNew(true); 1210 1211 newsEntry.setFlagvisible(true); 1213 newsEntry.setFlaglinks( false ); 1214 newsEntry.setFlagpictures( false ); 1215 newsEntry.setFlagfiles( false ); 1216 } 1217 else if(dataID > ComponentConstants.COMPONENT_NEW_DATAID) 1218 { 1219 newsEntry.setIsNew(false); 1221 newsEntry.setRowid(dataID); 1222 } 1223 else 1224 { 1225 LoggingManager.log("Base entry has uninitialized data ID " + cc.getDataID(), this); 1226 return false; 1227 } 1228 1229 nwsList.save(newsEntry); 1231 1232 dataID = newsEntry.getRowid(); 1234 cc.setDataID(dataID); 1235 } }catch(SQLException e) 1237 { 1238 LoggingManager.log("Cannot save news entry with data ID " + dataID + 1239 ". Exception: " + e.getMessage(), this); 1240 return false; 1241 } 1242 } 1244 1245 1248 1249 if(! propertiesEnabled) 1250 { 1251 try 1252 { 1253 1254 newsEntry = new Nwslist(); 1255 1256 1257 if(dataID == ComponentConstants.COMPONENT_NEW_DATAID) 1258 { 1259 newsEntry.setIsNew(true); 1261 1262 1264 newsEntry.setFlagvisible(true); 1265 newsEntry.setFlagtimedpub( false ); 1266 newsEntry.setFlaglinks( false ); 1267 newsEntry.setFlagpictures( false ); 1268 newsEntry.setFlagfiles( false ); 1269 1270 nwsList.save(newsEntry); 1272 1273 dataID = newsEntry.getRowid(); 1275 cc.setDataID(dataID); 1276 } 1277 else if(dataID > ComponentConstants.COMPONENT_NEW_DATAID) 1278 { 1279 newsEntry.setIsNew(false); 1281 newsEntry.setRowid(dataID); 1282 } 1283 else 1284 { 1285 LoggingManager.log("Base entry has uninitialized data ID " + cc.getDataID(), this); 1286 return false; 1287 } 1288 1289 1290 1291 }catch(SQLException e) 1292 { 1293 LoggingManager.log("Cannot save news entry with data ID " + dataID + 1294 ". Exception: " + e.getMessage(), this); 1295 return false; 1296 } 1297 } 1299 1300 1301 int linkedfiles=0; 1302 int linkedurls=0; 1303 int linkedpics=0; 1304 1305 enuCmps = cc.getComponents().elements(); 1307 while(enuCmps.hasMoreElements()) 1308 { 1309 ComponentBean cb = (ComponentBean) enuCmps.nextElement(); 1310 1311 String cmpID = cb.getData().getID(); 1312 try 1313 { 1314 1315 1316 1317 if( cmpID.equals(BaseConstants.COMPONENT_FILES_ID) ) 1318 { 1319 ((CmpFilesBean) cb).getFilesSelector() 1320 .saveLinkedFiles(gres, table, dataID, BaseConstants.RESFILEFIELD_FILE); 1321 linkedfiles=((CmpFilesBean) cb).getFilesSelector().getLinkedFiles().size(); 1322 } 1323 else if( cmpID.equals(BaseConstants.COMPONENT_PICS_ID) ) 1324 { 1325 ((CmpPicsBean) cb).getPicsSelector() 1326 .saveLinkedPictures(gres, table, dataID, BaseConstants.RESPICFIELD_PIC); 1327 linkedpics=((CmpPicsBean) cb).getPicsSelector().getLinkedPics().size(); 1328 } 1329 else if( cmpID.equals(BaseConstants.COMPONENT_LINKS_ID) ) 1330 { 1331 ((CmpLinksBean) cb).getLinksSelector() 1332 .saveLinks(gres, table, dataID, BaseConstants.RESURLFIELD_URL); 1333 linkedurls=((CmpLinksBean) cb).getLinksSelector().getList().size(); 1334 } 1335 else if( cmpID.equals(BaseConstants.COMPONENT_FIELDS_ID) ) 1336 { 1337 ((CmpFieldsBean) cb).getFieldsSelector() 1338 .saveFields(gres, table, dataID); 1339 } 1340 1341 else if( cmpID.equals(BaseConstants.COMPONENT_CATEGORIES_ID) ) 1342 { 1343 try 1344 { 1345 ((CmpCategoryBean) cb).getCategorySelector() 1346 .saveCatLinks(table, dataID, ""); 1347 }catch(SQLException e) 1348 { 1349 LoggingManager.log("Error while adding item:"+dataID+" to a category!",this); 1350 } 1351 1352 } 1353 } 1356 catch(SQLException e) { 1357 LoggingManager.log("Cannot save news entry with data ID " + dataID + 1358 ". Exception: " + e.getMessage(), this); 1359 return false; 1360 } 1361 } 1363 1364 if(linkedurls>0) newsEntry.setFlaglinks( true ); 1365 if(linkedpics>0) newsEntry.setFlagpictures( true ); 1366 if(linkedfiles>0) newsEntry.setFlagfiles( true ); 1367 try 1368 { 1369 nwsList.save(newsEntry); 1370 }catch(SQLException e) 1371 { 1372 LoggingManager.log("Cannot save news entry with data ID " + dataID + 1373 ". Exception: " + e.getMessage(), this); 1374 return false; 1375 } 1376 nwsList = null; 1377 LoggingManager.log("Saved entry id " + cc.getDataID() + " for vmodule " + vmodule.getIdentification(), this); 1378 return true; 1379 } 1380 1381 1384 public boolean saveEABaseListEntryFlags(EABaseListEntry lstEntry) 1385 { 1386 int id = lstEntry.getRowId(); 1387 if(id <= ComponentConstants.COMPONENT_NEW_DATAID) 1388 return false; 1390 nwsList = new NwslistManager(vmodule.getIdentification()); 1392 nwsList.setDataSource(vmodule.getDatasource()); 1393 1394 Nwslist newsEntry = new Nwslist(); 1395 try 1396 { 1397 newsEntry.setIsNew(false); 1398 newsEntry.setRowid(id); 1399 newsEntry.setFlagvisible(lstEntry.getFlagVisible()); 1400 newsEntry.setFlagentrydte(lstEntry.getFlagEntryDte()); 1401 newsEntry.setFlagtimedpub(lstEntry.getFlagTimedPub()); 1402 newsEntry.setFlaglinks(lstEntry.getFlagLinks()); 1403 newsEntry.setFlagpictures(lstEntry.getFlagPics()); 1404 newsEntry.setFlagfiles(lstEntry.getFlagFiles()); 1405 1406 nwsList.save(newsEntry); 1407 } 1408 catch(SQLException e) { 1409 LoggingManager.log("Cannot save news flags with data ID " + id + 1410 ". Exception: " + e.getMessage(), this); 1411 return false; 1412 } 1413 1414 nwsList = null; 1415 return true; 1416 } 1417 1418 1421 public boolean deleteEABaseListEntry(EABaseListEntry lstEntry) 1422 { 1423 int id = lstEntry.getRowId(); 1424 if(id <= ComponentConstants.COMPONENT_NEW_DATAID) 1425 return false; 1427 nwsList = new NwslistManager(vmodule.getIdentification()); 1429 nwsList.setDataSource(vmodule.getDatasource()); 1430 1431 1432 OwxurlsManager urlmanager=new OwxurlsManager(); 1433 String urltable=urlmanager.getTableID(); 1434 urlmanager=null; 1435 1436 OwxflinksManager filelinksmanager=new OwxflinksManager(); 1437 String filelinktable=filelinksmanager.getTableID(); 1438 filelinksmanager=null; 1439 1440 String table = nwsList.getTableID(); 1441 try 1442 { 1443 gres.deleteLocalizedFields(table, id ); 1445 1448 1449 1451 gres.deleteFields(table,id); 1452 1453 if(picturesEnabled) 1455 { 1456 Vector v=gres.deleteFileLinks(table, id, BaseConstants.RESPICFIELD_PIC); 1457 if(v!=null) 1458 for(int i=0;i<v.size();i++) 1459 { 1460 Integer I=(Integer )v.get(i); 1461 gres.deleteMessages(filelinktable, I.intValue(),BaseConstants.RESPICFIELD_LINK); 1462 } 1463 } 1464 1465 1466 1467 if(filesEnabled) 1469 { 1470 Vector v=gres.deleteFileLinks(table, id, BaseConstants.RESFILEFIELD_FILE); 1471 if(v!=null) 1472 for(int i=0;i<v.size();i++) 1473 { 1474 Integer I=(Integer )v.get(i); 1475 gres.deleteMessages(filelinktable, I.intValue(),BaseConstants.RESFILEFIELD_LINK); 1476 } 1477 } 1478 1479 if(linksEnabled) 1481 { 1482 Vector v=gres.deleteURLs(table, id, BaseConstants.RESURLFIELD_URL); 1483 if(v!=null) 1484 for(int i=0;i<v.size();i++) 1485 { 1486 Integer I=(Integer )v.get(i); 1487 gres.deleteMessages(urltable, I.intValue(),BaseConstants.RESURLFIELD_URL); 1488 } 1489 } 1490 1491 1493 gres.deleteCatLink(table,id); 1494 1495 nwsList.deleteByKey(id); 1497 } 1498 catch(SQLException e) { 1499 LoggingManager.log("Cannot delete news entry with data ID " + id + 1500 ". Exception: " + e.getMessage(), this); 1501 return false; 1502 } 1503 1504 nwsList = null; 1505 LoggingManager.log("Deleted entry id " + id + " from vmodule " + vmodule.getIdentification(), this); 1506 return true; 1507 } 1508 1509 1510 1513 public boolean isPreviewEnabled() { return previewEnabled; } 1514 1515 1518 public boolean arePropertiesEnabled() { return propertiesEnabled; } 1519 1520 1521 1524 public boolean areFilesEnabled() { return filesEnabled; } 1525 1526 1527 1530 public int getFilesCount() { return filesCount; } 1531 1532 1533 1536 public boolean arePicturesEnabled() { return picturesEnabled; } 1537 1538 1539 1542 public int getPicturesCount() { return picturesCount; } 1543 1544 1547 public boolean areLinksEnabled() { return linksEnabled; } 1548 1549 1552 public int getLinksCount() { return linksCount; } 1553 1554 1555 1556 1559 public boolean areCategoriesEnabled() { return categoriesEnabled; } 1560 1561 1564 public int getCategoryItemsCount() { return categoryItemCount; } 1565 1566 1569 public boolean areFieldsEnabled() { return fieldsEnabled; } 1570 1571} 1572 1573 | Popular Tags |