1 16 17 package Raptor.model; 18 19 import Jmc.baseTools.*; 20 import Jmc.baseGui.*; 21 import Jmc.connector.*; 22 import Jmc.commonGui.*; 23 24 import java.util.*; 25 26 36 public class raptor_settings 37 { 38 private String pem_iePath = null; 39 private String pem_tmpPath = null; 40 private Vector pem_tplKits = new Vector (); 41 private String pem_actTplKit = null; 42 private String pem_actTplKitPar = null; 43 44 private String pem_pluginDefFile = null; 45 private String pem_actPlugin = null; 46 private Vector pem_allPlugins = null; 47 48 private String pem_tapp_root = null; 49 private String pem_tapp_command = null; 50 private String pem_tapp_url = null; 51 private String pem_tapp_copy = null; 52 private String pem_tapp_target = null; 53 private boolean pem_doRestore = true; 54 55 public void pcmf_newPlugin() throws Exception 56 { 57 base_dialog_if l_br = (base_dialog_if)base_registredObject.pcmf_getObjByName("NewPlConfig_dlg"); 58 String l_name = (String )((base_guiObj)base_registredObject.pcmf_getObjByName("NewPlName")).pcmf_getValue(); 59 60 if (l_name != null) 61 { 62 if (base_environment.pcmf_getParameter(pem_pluginDefFile, "plugins", l_name) != null) 63 { 64 ((base_optionDlg_if)base_registredObject.pcmf_getObjByName("optDlg")).pcmf_showAlert("Can not create an existing plugin"); 65 return; 66 } 67 ((base_guiObj)base_registredObject.pcmf_getObjByName("plSwClass")).pcmf_setValue(""); 68 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlClass")).pcmf_setValue(""); 69 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlTpl")).pcmf_setValue(""); 70 ((base_guiObj)base_registredObject.pcmf_getObjByName("plXml")).pcmf_setValue(""); 71 ((base_guiObj)base_registredObject.pcmf_getObjByName("plStaticXml")).pcmf_setValue(""); 72 ((base_guiObj)base_registredObject.pcmf_getObjByName("plInitClass")).pcmf_setValue(""); 73 ((base_guiObj)base_registredObject.pcmf_getObjByName("plRootDir")).pcmf_setValue(""); 74 75 this.pem_actPlugin = l_name; 76 this.pem_allPlugins.add(l_name); 77 base_environment.pcmf_setParameter(this.pem_pluginDefFile,"plugins", this.pem_actPlugin, this.pem_actPlugin+"_def"); 78 ((base_comboBox_if)base_registredObject.pcmf_getObjByName("plAll")).pcmf_addValue(l_name, l_name); 79 80 this.pcmf_savePlDetail(); 81 } 82 83 l_br.pcmf_hideDialog(); 84 85 } 86 87 public void pcmf_readPluginDef() 88 { 89 pem_allPlugins = new Vector (); 90 ((base_guiObj)base_registredObject.pcmf_getObjByName("plDefFile")).pcmf_setValue(""); 91 ((base_comboBox_if)base_registredObject.pcmf_getObjByName("plAll")).pcmf_clearComboBox(); 92 try 93 { 94 pem_pluginDefFile = (String )base_environment.pcmf_getParameter(pem_actTplKitPar, "settings", "pluginDefFile"); 95 ((base_guiObj)base_registredObject.pcmf_getObjByName("plDefFile")).pcmf_setValue(this.pem_pluginDefFile); 96 if (pem_pluginDefFile != null) 97 { 98 Iterator l_it = base_environment.pcmf_getParameterKeys(pem_pluginDefFile, "plugins"); 99 String l_pl = null; 100 while (l_it.hasNext()) 101 { 102 l_pl = (String )l_it.next(); 103 pem_allPlugins.add(l_pl); 104 ((base_comboBox_if)base_registredObject.pcmf_getObjByName("plAll")).pcmf_addValue(l_pl, l_pl); 105 } 106 if (pem_allPlugins.size() != 0) 107 this.pem_actPlugin = pem_allPlugins.firstElement().toString(); 108 else 109 throw (new Exception ()); 110 } 111 else 112 throw (new Exception ()); 113 } 114 catch (Exception e) 115 { 116 base_log.pcmf_log("WiSer-Builder/start", "no plugins found", this, base_log.MESSAGE); 117 } 118 } 119 120 public void pcmf_showPlDetail() 121 { 122 try 123 { 124 ((base_guiObj)base_registredObject.pcmf_getObjByName("plSwClass")).pcmf_setValue(""); 125 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlClass")).pcmf_setValue(""); 126 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlTpl")).pcmf_setValue(""); 127 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlView")).pcmf_setValue(""); 128 ((base_guiObj)base_registredObject.pcmf_getObjByName("plXml")).pcmf_setValue(""); 129 ((base_guiObj)base_registredObject.pcmf_getObjByName("plStaticXml")).pcmf_setValue(""); 130 ((base_guiObj)base_registredObject.pcmf_getObjByName("plRootDir")).pcmf_setValue(""); 131 ((base_guiObj)base_registredObject.pcmf_getObjByName("plInitClass")).pcmf_setValue(""); 132 133 String pl_block = (String )base_environment.pcmf_getParameter(this.pem_pluginDefFile,"plugins", this.pem_actPlugin); 134 ((base_guiObj)base_registredObject.pcmf_getObjByName("plSwClass")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "swingClass", "")); 135 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlClass")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "htmlClass", "")); 136 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlTpl")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "htmlTemplate", "")); 137 ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlView")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "htmlRenderer", "")); 138 ((base_guiObj)base_registredObject.pcmf_getObjByName("plXml")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "xmlConf", "")); 139 ((base_guiObj)base_registredObject.pcmf_getObjByName("plStaticXml")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "staticXmlConf", "")); 140 ((base_guiObj)base_registredObject.pcmf_getObjByName("plRootDir")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "rootDir", "")); 141 ((base_guiObj)base_registredObject.pcmf_getObjByName("plInitClass")).pcmf_setValue(base_environment.pcmf_getParameter(pem_pluginDefFile, pl_block, "initClass", "")); 142 ((base_guiObj)base_registredObject.pcmf_getObjByName("plTable")).pcmf_repaint(); 143 ((base_guiObj)base_registredObject.pcmf_getObjByName("plTable2")).pcmf_repaint(); 144 } 145 catch (Exception e) 146 { 147 base_log.pcmf_log("raptor", "error reading plugin details", this, base_log.ERROR); 148 } 149 } 150 151 public void pcmf_savePlDetail() 152 { 153 try 154 { 155 String pl_block = (String )base_environment.pcmf_getParameter(this.pem_pluginDefFile,"plugins", this.pem_actPlugin); 156 base_environment.pcmf_addParameterCluster(pem_pluginDefFile, pl_block); 157 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "swingClass", ((base_guiObj)base_registredObject.pcmf_getObjByName("plSwClass")).pcmf_getValue()); 158 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "htmlClass", ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlClass")).pcmf_getValue()); 159 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "htmlTemplate", ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlTpl")).pcmf_getValue()); 160 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "htmlRenderer", ((base_guiObj)base_registredObject.pcmf_getObjByName("plHtmlView")).pcmf_getValue()); 161 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "xmlConf", ((base_guiObj)base_registredObject.pcmf_getObjByName("plXml")).pcmf_getValue()); 162 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "rootDir", ((base_guiObj)base_registredObject.pcmf_getObjByName("plRootDir")).pcmf_getValue()); 163 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "staticXmlConf", ((base_guiObj)base_registredObject.pcmf_getObjByName("plStaticXml")).pcmf_getValue()); 164 base_environment.pcmf_setParameter(pem_pluginDefFile, pl_block, "initClass", ((base_guiObj)base_registredObject.pcmf_getObjByName("plInitClass")).pcmf_getValue()); 165 166 this.pem_writer.pcmf_writeSource(base_environment.pcmf_getParameterGetter(), this.pem_pluginDefFile, this.pem_pluginDefFile); 167 168 ((base_guiObj)base_registredObject.pcmf_getObjByName("plTable")).pcmf_repaint(); 169 } 170 catch (Exception e) 171 { 172 base_log.pcmf_log("raptor", "error writing plugin details", this, base_log.ERROR); 173 } 174 } 175 176 private xml_parameterWriter pem_writer = new xml_parameterWriter(); 177 180 public raptor_settings() 181 { 182 this.pcmf_loadSettings(); 183 } 184 185 public void pcmf_loadSettings() 186 { 187 try 188 { 189 this.pem_iePath = (String )base_environment.pcmf_getParameter("environment.xml", "paths", "viewer_path"); 190 this.pem_tmpPath = (String )base_environment.pcmf_getParameter("environment.xml", "paths", "tmp_path"); 191 this.pem_tmpPath = base_environment.pcmf_buildPath(this.pem_tmpPath); 192 193 this.pem_tapp_root = (String )base_environment.pcmf_getParameter("environment.xml", "TEST_APP", "TAPP_ROOT"); 194 this.pem_tapp_target = (String )base_environment.pcmf_getParameter("environment.xml", "TEST_APP", "TAPP_TARGET"); 195 this.pem_tapp_command = (String )base_environment.pcmf_getParameter("environment.xml", "TEST_APP", "TAPP_COMMAND"); 196 this.pem_tapp_url = (String )base_environment.pcmf_getParameter("environment.xml", "TEST_APP", "TAPP_URL"); 197 this.pem_tapp_copy = (String )base_environment.pcmf_getParameter("environment.xml", "TEST_APP", "TAPP_COPY"); 198 this.pem_doRestore = base_environment.pcmf_getParameter("environment.xml", "DESKTOP", "RESTORE").toString().equals("true")?true:false; 199 200 Iterator l_it = base_environment.pcmf_getParameterKeys("environment.xml", "templateKitMap"); 201 while (l_it.hasNext()) 202 this.pem_tplKits.add(l_it.next()); 203 204 this.pem_actTplKit = this.pem_tplKits.get(0).toString(); 205 this.pem_actTplKitPar = (String )base_environment.pcmf_getParameter("environment.xml", pem_actTplKit, "FACTORY_DEF"); 206 } 207 catch (Exception e) 208 { 209 base_log.pcmf_log("WiSer-Builder/start", "error reading parameters", this, base_log.ERROR); 210 } 211 } 212 213 public void pcmf_writeSettings() 214 { 215 try 216 { 217 base_environment.pcmf_setParameter("environment.xml", "paths", "viewer_path", this.pem_iePath); 218 base_environment.pcmf_setParameter("environment.xml", "paths", "tmp_path", this.pem_tmpPath); 219 220 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "FACTORY_DEF", this.pem_actTplKitPar); 221 base_environment.pcmf_setParameter("environment.xml", "DESKTOP", "RESTORE", ((base_guiObj)base_registredObject.pcmf_getObjByName("restoreDesktop")).pcmf_getValue().equals(base_checkBox_if.CHECKED)?"true":"false"); 222 223 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "SUBMIT", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_SUBMIT")).pcmf_getValue()); 224 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "SUBMIT_T", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_SUBMIT_T")).pcmf_getValue()); 225 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "TOOLTIP", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_TOOLTIP")).pcmf_getValue()); 226 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "COLORS", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COLORS")).pcmf_getValue()); 227 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "POSITION", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_POSITION")).pcmf_getValue()); 228 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "DPOSITION", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_DPOSITION")).pcmf_getValue()); 229 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "DLPOSITION", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_DLPOSITION")).pcmf_getValue()); 230 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CHANNEL_DRAG", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_DRAG")).pcmf_getValue()); 231 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CHANNEL_DROP", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_DROP")).pcmf_getValue()); 232 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CHANNEL_GF", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_GF")).pcmf_getValue()); 233 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CHANNEL_LF", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_LF")).pcmf_getValue()); 234 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CHANNEL_CLK", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CHANNEL_CLK")).pcmf_getValue()); 235 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "CTXMENU", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_CTXMENU")).pcmf_getValue()); 236 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "FONT", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FONT")).pcmf_getValue()); 237 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "FOCUS", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FOCUS")).pcmf_getValue()); 238 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "BGIMG", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_BGIMG")).pcmf_getValue()); 239 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "BORDER", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_BORDER")).pcmf_getValue()); 240 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "FSIZE", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_FSIZE")).pcmf_getValue()); 241 242 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "WRAP", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_WRAP")).pcmf_getValue()); 243 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "WRAPCOM", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_WRAPCOM")).pcmf_getValue()); 244 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "COMFRAME", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COMFRAME")).pcmf_getValue()); 245 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "INSERTOL", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_INSERTOL")).pcmf_getValue()); 246 base_environment.pcmf_setParameter("environment.xml", pem_actTplKit, "COMFRAMEFR", ((base_guiObj)base_registredObject.pcmf_getObjByName("TPL_COMFRAMEFR")).pcmf_getValue()); 247 248 base_environment.pcmf_setParameter("environment.xml", "TEST_APP", "TAPP_ROOT", ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_ROOT")).pcmf_getValue()); 249 base_environment.pcmf_setParameter("environment.xml", "TEST_APP", "TAPP_TARGET", ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_TARGET")).pcmf_getValue()); 250 base_environment.pcmf_setParameter("environment.xml", "TEST_APP", "TAPP_COMMAND", ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COMMAND")).pcmf_getValue()); 251 base_environment.pcmf_setParameter("environment.xml", "TEST_APP", "TAPP_URL", ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_URL")).pcmf_getValue()); 252 base_environment.pcmf_setParameter("environment.xml", "TEST_APP", "TAPP_COPY", ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COPY")).pcmf_getValue()); 253 254 this.pem_tapp_root = ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_ROOT")).pcmf_getValue().toString(); 255 this.pem_tapp_target = ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_TARGET")).pcmf_getValue().toString(); 256 this.pem_tapp_command = ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COMMAND")).pcmf_getValue().toString(); 257 this.pem_tapp_url = ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_URL")).pcmf_getValue().toString(); 258 this.pem_tapp_copy = ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COPY")).pcmf_getValue().toString(); 259 this.pem_doRestore = ((base_guiObj)base_registredObject.pcmf_getObjByName("restoreDesktop")).pcmf_getValue().toString().equals(base_checkBox_if.CHECKED)?true:false; 260 261 this.pem_writer.pcmf_writeSource(base_environment.pcmf_getParameterGetter(), "environment.xml", "environment.xml"); 262 } 263 catch (Exception e) 264 { 265 base_log.pcmf_log("WiSer-Builder/start", "error writing parameters", this, base_log.ERROR); 266 } 267 } 268 278 public String getPem_iePath() 279 { 280 return pem_iePath; 281 } 282 283 293 public String getPem_tmpPath() 294 { 295 return pem_tmpPath; 296 } 297 298 308 public void setPem_iePath(String string) 309 { 310 pem_iePath = string; 311 } 312 313 323 public void setPem_tmpPath(String string) 324 { 325 pem_tmpPath = string; 326 } 327 328 338 public String getPem_actTplKit() 339 { 340 return pem_actTplKit; 341 } 342 343 353 public String getPem_actTplKitPar() 354 { 355 return pem_actTplKitPar; 356 } 357 358 368 public Vector getPem_tplKits() 369 { 370 return pem_tplKits; 371 } 372 373 383 public void setPem_actTplKit(String string) 384 { 385 pem_actTplKit = string; 386 } 387 388 398 public void setPem_actTplKitPar(String string) 399 { 400 pem_actTplKitPar = string; 401 } 402 403 413 public xml_parameterWriter getPem_writer() 414 { 415 return pem_writer; 416 } 417 418 428 public void setPem_actPlugin(String string) 429 { 430 pem_actPlugin = string; 431 } 432 433 443 public String getPem_tapp_command() 444 { 445 return pem_tapp_command; 446 } 447 448 458 public String getPem_tapp_copy() 459 { 460 return pem_tapp_copy; 461 } 462 463 473 public String getPem_tapp_root() 474 { 475 return pem_tapp_root; 476 } 477 478 488 public String getPem_tapp_target() 489 { 490 return pem_tapp_target; 491 } 492 493 503 public String getPem_tapp_url() 504 { 505 return pem_tapp_url; 506 } 507 508 518 public void setPem_tapp_command(String string) 519 { 520 pem_tapp_command = string; 521 } 522 523 533 public void setPem_tapp_copy(String string) 534 { 535 pem_tapp_copy = string; 536 } 537 538 548 public void setPem_tapp_root(String string) 549 { 550 pem_tapp_root = string; 551 } 552 553 563 public void setPem_tapp_target(String string) 564 { 565 pem_tapp_target = string; 566 } 567 568 578 public void setPem_tapp_url(String string) 579 { 580 pem_tapp_url = string; 581 } 582 583 586 public boolean isPem_doRestore() 587 { 588 return pem_doRestore; 589 } 590 591 594 public void setPem_doRestore(boolean pem_doRestore) 595 { 596 this.pem_doRestore = pem_doRestore; 597 } 598 } | Popular Tags |