1 5 6 package com.raptus.owxv3.modules.submitter; 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 17 import com.raptus.owxv3.modules.base.BaseObject; 19 import com.raptus.owxv3.modules.base.NwslistManager; 20 import com.raptus.owxv3.modules.base.Nwslist; 21 import com.raptus.owxv3.modules.base.PubBaseEntry; 22 23 46 public class SubmitterObject extends BusinessObject 47 implements ComponentBusinessObject 48 { 49 52 protected NwslistManager nwsList = null; 53 54 57 protected GlobalResources gres = null; 58 59 62 63 public SubmitterObject(VModule vm, Locale lcle) 64 { 65 super(vm, lcle); 66 gres = new GlobalResources(); 67 } 68 69 73 public Vector loadEASubmitterListEntries() 74 { 75 XMLConfigManager cm = XMLConfigManager.getInstance(); 77 String [] selvmodules = cm.getStringArrayByTree("virtualhost/vmodules/vmodule?name=" + 78 vmodule.getIdentification() + 79 "/properties/property?name=vmodules","items"); 80 81 VModuleManager vmm = VModuleManager.getInstance(); 82 Vector submList = new Vector(selvmodules.length); 83 for(int i = 0; i < selvmodules.length; i ++) 84 { 85 String vmtitle = cm.getPropertyByTree("virtualhost/vmodules/vmodule?name=" + selvmodules[i] + 87 "/section/eadmin/element?name=index" + 88 "/property?name=displayname/label?locale=" + 89 locale.toString(),"value"); 90 91 String listpart = cm.getPropertyByTree("virtualhost/vmodules/vmodule?name=" + vmodule.getIdentification() + 93 "/properties/property?name=" + selvmodules[i] + 94 "/property?name=listpart","value"); 95 96 VModule vm = vmm.getVModule(selvmodules[i]); 98 Vector vmentrylist = loadAllEntriesForVModule(vm); 99 100 EASubmitterListEntry sle = new EASubmitterListEntry(); 102 sle.setTitle(vmtitle); 103 sle.setListpart(listpart); 104 105 PairOfObjects po = new PairOfObjects(sle, vmentrylist); 107 submList.insertElementAt(po, 0); 108 } 109 110 return submList; 111 } 112 113 protected Vector loadAllEntriesForVModule(VModule vm) 114 { 115 Vector newsPubList = null; 116 nwsList = new NwslistManager(vm.getIdentification()); 117 nwsList.setDataSource(vm.getDatasource()); 118 119 String table = nwsList.getTableID(); 120 try 121 { 122 String where = "flagVisible = false OR flagVisible = true"; 123 Nwslist[] list = nwsList.loadByWhere(where, "entrydte DESC", 0); 124 125 newsPubList = new Vector(list.length); boolean entry_valid=true; 127 for(int i = 0; i < list.length; i ++) 128 { 129 Nwslist entry = list[i]; 130 entry_valid=true; 131 PubBaseEntry pne = new PubBaseEntry(); 132 pne.setBaseID(entry.getRowid()); 133 134 pne.setEntryDate( getLocaleFormattedDate(entry.getEntrydte()) ); 135 pne.setFieldList( gres.loadFields(table,entry.getRowid()) ); 136 pne.setLocalizedFieldList( gres.loadLocalizedFields(table, entry.getRowid()) ); 137 138 newsPubList.addElement(pne); 139 } 140 } 141 catch(SQLException e) { 142 LoggingManager.log("SQLException during retrieval of pub news list! " + e.getMessage(), this); 143 } 144 145 nwsList = null; 146 return newsPubList; 147 } 148 149 152 public boolean loadComponentData(ComponentContainer cc) 153 { 154 return false; 155 } 156 157 160 public boolean loadComponentDefaultData(ComponentContainer cc) 161 { 162 return false; 163 } 164 165 168 public boolean saveComponentData(ComponentContainer cc) 169 { 170 return false; 171 } 172 173 } 174 175 | Popular Tags |