1 package org.webdocwf.util.loader.wizard; 2 3 import java.awt.Color ; 4 import java.awt.Dimension ; 5 import java.awt.Toolkit ; 6 import java.awt.event.ActionEvent ; 7 import java.awt.event.MouseAdapter ; 8 import java.awt.event.MouseEvent ; 9 import java.awt.event.MouseListener ; 10 import java.io.File ; 11 import java.io.FileInputStream ; 12 import java.io.InputStream ; 13 14 import javax.swing.AbstractAction ; 15 import javax.swing.ImageIcon ; 16 import javax.swing.JButton ; 17 import javax.swing.JDesktopPane ; 18 import javax.swing.JFileChooser ; 19 import javax.swing.JFrame ; 20 import javax.swing.JMenu ; 21 import javax.swing.JMenuBar ; 22 import javax.swing.JMenuItem ; 23 import javax.swing.JOptionPane ; 24 import javax.swing.JPopupMenu ; 25 import javax.swing.JToolBar ; 26 import javax.swing.KeyStroke ; 27 import javax.swing.UIManager ; 28 29 30 public class WizardFrame extends JFrame { 31 private WizardFrame wizardFrame; 32 private JDesktopPane desktop; 33 private JPopupMenu popUp; 34 private static boolean startOctopusLoader = false; 35 private static String pathToXmlFile = ""; 36 private static boolean startOctopusProject = false; 37 private static String pathToProjectFile = ""; 38 private static String confJarStructure = ""; 39 private static int defaultProjectNameCounter = 1; 40 private static final String DEFAULT_PROJECT_NAME = "Untitled project"; 41 42 public WizardFrame(String title) { 43 super(title); 44 wizardFrame = this; 45 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); 46 desktop = new JDesktopPane (); 47 setContentPane(desktop); 48 49 desktop.setBackground(new Color (210, 210, 210)); 53 54 createMenuBar(); 55 createPopupMenu(); 56 57 if (startOctopusLoader) { 58 try { 59 OctopusProjectFrame octopusProject = createOctopusProjectFrame(DEFAULT_PROJECT_NAME+defaultProjectNameCounter++); 60 octopusProject.getLoaderPanel().setOctopusLoaderInit( 62 new OctopusLoaderData(), 63 pathToXmlFile, 64 confJarStructure); 65 octopusProject.setActiveTab(1); 66 desktop.add(octopusProject); 67 octopusProject.setVisible(true); 68 octopusProject.requestFocus(); 69 } catch (Exception ex) { 70 String message = "Error while starting OctopusWizard . Message : "; 71 message += ex.getMessage(); 72 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 73 System.exit(0); 74 } 75 } else if( startOctopusProject ) { 76 try { 77 OctopusProperties properties = new OctopusProperties(); 78 InputStream is=new FileInputStream (pathToProjectFile); 79 properties.load(is); 80 String name = properties.getOctopusProperty("ProjectName"); 81 if (name == null || name.trim().equals("")) 82 name = DEFAULT_PROJECT_NAME+defaultProjectNameCounter++; 83 OctopusProjectFrame octopusProject = createOctopusProjectFrame(name); 84 confJarStructure = properties.getOctopusProperty("Generator.ConfJarStructure"); 85 OctopusGeneratorData generatorData = new OctopusGeneratorData(confJarStructure); 86 87 setGeneratorData(properties,generatorData); 89 90 octopusProject.getGeneratorPanel().setOctopusGeneratorInit( 91 generatorData, 92 confJarStructure); 93 OctopusLoaderData loaderData = new OctopusLoaderData(); 95 setLoaderData(properties,loaderData); 96 98 99 octopusProject.getLoaderPanel().setOctopusLoaderInit( 100 loaderData, 101 null, 102 confJarStructure); 103 104 desktop.add(octopusProject); 105 octopusProject.setVisible(true); 106 octopusProject.requestFocus(); 107 } catch (Exception ex) { 108 String message = "Error while starting OctopusWizard . Message : "; 109 message += ex.getMessage(); 110 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 111 System.exit(0); 112 } 113 } 114 } 115 116 protected void createMenuBar() { 117 JMenuBar mb = new JMenuBar (); 118 JMenu menu = new JMenu ("Project"); 119 menu.setMnemonic('P'); 120 JMenu menu2 = new JMenu ("IDEOptions"); 121 menu2.setMnemonic('I'); 122 JMenu menu3 = new JMenu ("Help"); 123 menu3.setMnemonic('H'); 124 125 menu.add(new NewOctopusProjectItem()); menu.add(new OpenOctopusProjectItem()); menu.add(new ExitOctopusApplicationItem()); menu2.add(new LnFActionMetal()); menu2.add(new LnFActionMotif()); 130 menu2.add(new LnFActionWindows()); 131 menu2.add(new LnFActionJava()); 132 menu3.add(new OctopusHelpAction("Help")); 133 menu3.addSeparator(); 134 menu3.add(new OctopusAboutAction()); 135 136 setJMenuBar(mb); 137 mb.add(menu); 138 mb.add(menu2); 139 mb.add(menu3); 140 } 141 142 143 public void createPopupMenu() { 144 JMenuItem menuItem; 145 146 JPopupMenu popup = new JPopupMenu (); 148 JMenuItem popupItem = new JMenuItem ("Start new Octopus project"); 149 popupItem.setAction(new NewOctopusProjectItem()); 150 JMenuItem popupItem2 = new JMenuItem ("Open existing Octopus project"); 151 popupItem2.setAction(new OpenOctopusProjectItem()); 152 JMenuItem popupItem3 = new JMenuItem ("Exit Octopus Application"); 153 popupItem3.setAction(new ExitOctopusApplicationItem()); 154 155 popup.add(popupItem); 156 popup.add(popupItem2); 157 popup.add(popupItem3); 158 159 MouseListener popupListener = new PopupListener(popup); 161 desktop.addMouseListener(popupListener); 162 } 163 164 public static void main(String [] args) { 165 166 OctopusSplash octopusSplash = new OctopusSplash("splash_octopus.gif", null); 167 168 if (args.length > 0 && args.length < 5) { 169 for (int i = 0; i < args.length - 1; i = i + 1) { 170 if (args[i].equalsIgnoreCase("-sol")) { 171 pathToXmlFile = args[++i]; 172 if (!pathToXmlFile.equalsIgnoreCase("")) 173 startOctopusLoader = true; 174 } 175 if (args[i].equalsIgnoreCase("-sop")) { 176 pathToProjectFile = args[++i]; 177 if (!pathToProjectFile.equalsIgnoreCase("")) 178 startOctopusProject = true; 179 } 180 if (args[i].equalsIgnoreCase("-cjs")) { 181 confJarStructure = args[++i]; 182 } 183 } 184 } 185 try { 186 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 187 } catch (Exception e) { 188 e.printStackTrace(); 189 } 190 WizardFrame wizardFrame = new WizardFrame("Enhydra Octopus Application"); 191 192 198 wizardFrame.setIconImage( 199 new ImageIcon (WizardFrame.class.getResource("images/Enhydra16.gif")).getImage()); 200 201 Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 202 wizardFrame.setBounds(0, 0, dimension.width - 20, dimension.height - 40); 203 204 try { 205 Thread.sleep(2500); 206 } catch (Exception e) { 207 e.printStackTrace(); 208 } 209 OctopusSplash.getSplash().hideSplash(); 210 octopusSplash = null; 211 wizardFrame.setVisible(true); 212 } 213 214 private OctopusProjectFrame createOctopusProjectFrame(String name) throws Exception { 215 216 JMenuBar mb = new JMenuBar (); 218 JMenu menu = new JMenu ("Application"); 219 menu.setMnemonic('A'); 220 JMenuItem startGenerator = new JMenuItem ("Start Generator"); 221 JMenuItem startLoader = new JMenuItem ("Start Loader"); 222 JMenuItem save = new JMenuItem ("Save project"); 223 JMenuItem stop = new JMenuItem ("Close project"); 224 JMenuItem help = new JMenuItem ("Help"); 225 menu.add(startGenerator); 226 menu.add(startLoader); 227 menu.addSeparator(); 228 menu.add(save); 229 menu.add(stop); 230 menu.addSeparator(); 231 menu.add(help); 232 mb.add(menu); 233 234 JButton startGeneratorButton = 236 OctopusProjectFrame.createOctopusButton( 237 "Start Generator", 238 OctopusGeneratorPanel.toolBarButton); 239 JButton startLoaderButton = 240 OctopusProjectFrame.createOctopusButton( 241 "Start Loader", 242 OctopusGeneratorPanel.toolBarButton); 243 JButton stopButton = 244 OctopusProjectFrame.createOctopusButton("Stop", OctopusGeneratorPanel.toolBarButton); 245 JButton saveButton = 246 OctopusProjectFrame.createOctopusButton("Save", OctopusGeneratorPanel.toolBarButton); 247 JButton helpButton = 248 OctopusProjectFrame.createOctopusButton("Help", OctopusGeneratorPanel.toolBarButton); 249 JToolBar toolBar = new JToolBar ("Octopus toolbar"); 250 toolBar.add(startGeneratorButton); 251 toolBar.add(startLoaderButton); 253 toolBar.addSeparator(); 254 toolBar.add(saveButton); 255 toolBar.add(stopButton); 257 toolBar.addSeparator(); 258 toolBar.add(helpButton); 259 OctopusGeneratorPanel generatorPanel = new OctopusGeneratorPanel(); 261 generatorPanel.setOctopusGeneratorInit( 262 new OctopusGeneratorData(confJarStructure), 263 confJarStructure); 264 OctopusLoaderPanel loaderPanel = new OctopusLoaderPanel(); 266 loaderPanel.setOctopusLoaderInit(new OctopusLoaderData(), null, confJarStructure); 267 OctopusProjectFrame octopusProject = 269 new OctopusProjectFrame(name, loaderPanel, generatorPanel, toolBar); 270 octopusProject.getRootPane().setJMenuBar(mb); 271 startGenerator.setAction(new StartOctopusGeneratorAction(octopusProject, "Start Generator")); 273 startLoader.setAction(new StartOctopusLoaderAction(octopusProject, "Start Loader")); 274 stop.setAction(new CloseOctopusProjectAction(octopusProject, "Close")); 275 save.setAction(new SaveProjectAction(octopusProject, "Save")); 276 help.setAction(new OctopusHelpAction("Help")); 277 startGeneratorButton.setAction(new StartOctopusGeneratorAction(octopusProject, "")); 279 startLoaderButton.setAction(new StartOctopusLoaderAction(octopusProject, "")); 280 stopButton.setAction(new CloseOctopusProjectAction(octopusProject, "")); 281 saveButton.setAction(new SaveProjectAction(octopusProject, "")); 282 helpButton.setAction(new OctopusHelpAction("")); 283 return octopusProject; 285 } 286 287 private class ExitOctopusApplicationItem extends AbstractAction { 288 291 public ExitOctopusApplicationItem() { 292 putValue(NAME, "Exit"); 293 putValue( 294 ACCELERATOR_KEY, 295 KeyStroke.getKeyStroke('X', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 296 putValue( 297 SMALL_ICON, 298 new ImageIcon ( 299 getClass().getClassLoader().getResource( 300 "org/webdocwf/util/loader/" + "wizard/images/Stop.gif"))); 301 putValue(SHORT_DESCRIPTION, "Exit Enhydra Octopus Application"); 302 putValue(LONG_DESCRIPTION, "Exit Enhydra Octopus Application"); 303 putValue(MNEMONIC_KEY, new Integer ('X')); 304 } 305 306 public void actionPerformed(ActionEvent e) { 307 try { 308 if( 309 JOptionPane.showConfirmDialog(null, "Are you are sure want to exit?", "Exit", JOptionPane.INFORMATION_MESSAGE) == 0 310 ) 311 { 312 System.exit(0); 313 } 314 } catch (Exception ex) { 315 String message = 316 "Error while creating action for ExitOctopusApplicationItem menu item. Message :" 317 + ex.getMessage(); 318 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 319 } 320 321 } 322 } 323 324 private class NewOctopusProjectItem extends AbstractAction { 325 328 public NewOctopusProjectItem() { 329 putValue(NAME, "New Octopus Project"); 330 putValue( 331 ACCELERATOR_KEY, 332 KeyStroke.getKeyStroke('N', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 333 putValue( 334 SMALL_ICON, 335 new ImageIcon ( 336 getClass().getClassLoader().getResource( 337 "org/webdocwf/util/loader/" + "wizard/images/New.gif"))); 338 putValue(SHORT_DESCRIPTION, "Octopus project"); 339 putValue(LONG_DESCRIPTION, "Start Octopus project"); 340 putValue(MNEMONIC_KEY, new Integer ('N')); 341 } 342 343 public void actionPerformed(ActionEvent e) { 344 try { 345 String name = (String ) JOptionPane.showInputDialog(null, 346 "Project name : ", 347 "New project...", 348 JOptionPane.INFORMATION_MESSAGE, 349 null, 350 null, 351 DEFAULT_PROJECT_NAME+defaultProjectNameCounter++); 352 if( name != null ) { 353 if (name == null || name.trim().equals("")) 354 name = DEFAULT_PROJECT_NAME+defaultProjectNameCounter++; 355 OctopusProjectFrame octopusProject = createOctopusProjectFrame(name); 356 desktop.add(octopusProject); 357 octopusProject.setVisible(true); 358 octopusProject.requestFocus(); 359 } else { 360 } 362 363 } catch (Exception ex) { 364 String message = 365 "Error while creating action for NewOctopusProject menu item. Message :" 366 + ex.getMessage(); 367 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 368 } 369 370 } 371 } 372 373 private class OpenOctopusProjectItem extends AbstractAction { 374 377 public OpenOctopusProjectItem() { 378 putValue(NAME, "Open existing Octopus Project"); 379 putValue( 380 ACCELERATOR_KEY, 381 KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 382 putValue( 383 SMALL_ICON, 384 new ImageIcon ( 385 getClass().getClassLoader().getResource( 386 "org/webdocwf/util/loader/" + "wizard/images/Open.gif"))); 387 putValue(SHORT_DESCRIPTION, "Octopus project"); 388 putValue(LONG_DESCRIPTION, "Open Octopus project"); 389 putValue(MNEMONIC_KEY, new Integer ('0')); 390 } 391 392 public void actionPerformed(ActionEvent e) { 393 try { 394 File current = new File (System.getProperty("user.dir")); 395 JFileChooser chooser = new JFileChooser (current); 396 chooser.setDialogTitle("Open Octopus project ..."); 397 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); 398 chooser.setFileFilter( 399 (javax 400 .swing 401 .filechooser 402 .FileFilter) new OctopusFileFilter(OctopusFileFilter 403 .OPF)); 404 chooser.setAcceptAllFileFilterUsed(false); 405 406 chooser.setApproveButtonText("Open"); 407 int v = chooser.showOpenDialog(desktop); 408 409 switch (v) { 410 case JFileChooser.APPROVE_OPTION : 411 if (chooser.getSelectedFile() != null) { 412 openProject(chooser.getSelectedFile()); 413 } 414 break; 415 case JFileChooser.CANCEL_OPTION : 416 case JFileChooser.ERROR_OPTION : 417 chooser.removeAll(); 418 chooser = null; 419 current = null; 420 421 } 422 423 } catch (Exception ex) { 424 String message = 425 "Error while creating action for OpenOctopusProject menu item. Message :" 426 + ex.getMessage(); 427 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 428 } 429 } 430 431 private void openProject(File projectFile) throws Exception { 432 OctopusProperties properties = new OctopusProperties(); 433 InputStream is=new FileInputStream (projectFile); 434 properties.load(is); 435 String name = properties.getOctopusProperty("ProjectName"); 436 if (name == null || name.trim().equals("")) 437 name = DEFAULT_PROJECT_NAME+defaultProjectNameCounter++; 438 OctopusProjectFrame octopusProject = createOctopusProjectFrame(name); 439 confJarStructure = properties.getOctopusProperty("Generator.ConfJarStructure"); 440 OctopusGeneratorData generatorData = new OctopusGeneratorData(confJarStructure); 441 setGeneratorData(properties,generatorData); 442 443 octopusProject.getGeneratorPanel().setOctopusGeneratorInit( 444 generatorData, 445 confJarStructure); 446 OctopusLoaderData loaderData = new OctopusLoaderData(); 448 setLoaderData(properties,loaderData); 449 450 451 octopusProject.getLoaderPanel().setOctopusLoaderInit( 452 loaderData, 453 null, 454 confJarStructure); 455 456 desktop.add(octopusProject); 457 octopusProject.setVisible(true); 458 octopusProject.requestFocus(); 459 } 460 } 461 462 private class LnFActionMetal extends AbstractAction { 463 464 public LnFActionMetal() { 465 466 putValue(NAME, "Metal Look&Feel"); 467 putValue( 468 ACCELERATOR_KEY, 469 KeyStroke.getKeyStroke('M', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 470 putValue(SHORT_DESCRIPTION, "Metal Look & Feel"); 471 putValue(LONG_DESCRIPTION, "Set Metal Look & Feel Model"); 472 putValue(MNEMONIC_KEY, new Integer ('M')); 473 } 474 475 public void actionPerformed(ActionEvent e) { 476 LnFListener lnf = new LnFListener(wizardFrame); 477 lnf.actionPerformed(e); 478 } 479 } 480 481 private class LnFActionMotif extends AbstractAction { 482 483 public LnFActionMotif() { 484 485 putValue(NAME, "Motif Look&Feel"); 486 putValue( 487 ACCELERATOR_KEY, 488 KeyStroke.getKeyStroke('F', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 489 putValue(SHORT_DESCRIPTION, "Motif Look & Feel"); 490 putValue(LONG_DESCRIPTION, "Set Motif Look & Feel Model"); 491 putValue(MNEMONIC_KEY, new Integer ('F')); 492 } 493 494 public void actionPerformed(ActionEvent e) { 495 LnFListener lnf = new LnFListener(wizardFrame); 496 lnf.actionPerformed(e); 497 } 498 } 499 500 private class LnFActionWindows extends AbstractAction { 501 502 public LnFActionWindows() { 503 504 putValue(NAME, "Windows Look&Feel"); 505 putValue( 506 ACCELERATOR_KEY, 507 KeyStroke.getKeyStroke('W', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 508 putValue(SHORT_DESCRIPTION, "Windows Look & Feel"); 509 putValue(LONG_DESCRIPTION, "Set Windows Look & Feel Model"); 510 putValue(MNEMONIC_KEY, new Integer ('W')); 511 } 512 513 public void actionPerformed(ActionEvent e) { 514 LnFListener lnf = new LnFListener(wizardFrame); 515 lnf.actionPerformed(e); 516 } 517 } 518 519 private class LnFActionJava extends AbstractAction { 520 521 public LnFActionJava() { 522 523 putValue(NAME, "Java Look&Feel"); 524 putValue( 525 ACCELERATOR_KEY, 526 KeyStroke.getKeyStroke('J', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 527 putValue(SHORT_DESCRIPTION, "Java Look & Feel"); 528 putValue(LONG_DESCRIPTION, "Set Java Look & Feel Model"); 529 putValue(MNEMONIC_KEY, new Integer ('J')); 530 } 531 532 public void actionPerformed(ActionEvent e) { 533 LnFListener lnf = new LnFListener(wizardFrame); 534 lnf.actionPerformed(e); 535 } 536 } 537 538 class PopupListener extends MouseAdapter { 539 JPopupMenu popup; 540 541 PopupListener(JPopupMenu popupMenu) { 542 popup = popupMenu; 543 } 544 545 public void mousePressed(MouseEvent e) { 546 showPopup(e); 547 } 548 549 public void mouseReleased(MouseEvent e) { 550 showPopup(e); 551 } 552 553 private void showPopup(MouseEvent e) { 554 if (e.isPopupTrigger()) { 555 popup.show(e.getComponent(), e.getX(), e.getY()); 556 } 557 } 558 } 559 560 private class OctopusHelpAction extends AbstractAction { 561 562 565 public OctopusHelpAction(String label) { 566 putValue(NAME, label); 567 putValue( 568 SMALL_ICON, 569 new ImageIcon ( 570 getClass().getClassLoader().getResource( 571 "org/webdocwf/util/loader/" + "wizard/images/Help16.gif"))); 572 putValue(SHORT_DESCRIPTION, "Help for running the program"); 573 putValue(LONG_DESCRIPTION, "Help for running the program"); 574 putValue( 575 ACCELERATOR_KEY, 576 KeyStroke.getKeyStroke('H', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 577 putValue(MNEMONIC_KEY, new Integer ('H')); 578 } 579 580 584 public void actionPerformed(ActionEvent e) { 585 try { 586 OctopusGeneratorHelpFrame helpFrame = new OctopusGeneratorHelpFrame(); 587 helpFrame.setIconImage( 588 new ImageIcon ( 589 getClass().getClassLoader().getResource( 590 "org/webdocwf/util/loader/" + "wizard/images/Enhydra16.gif")) 591 .getImage()); 592 helpFrame.setVisible(true); 593 } catch (Exception ex) { 594 String message = 595 "Error while creating action for OctopusHelp menu item. Message :" 596 + ex.getMessage(); 597 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 598 System.exit(0); 599 } 600 } 601 } 602 603 private OctopusAboutFrame createOctopusAboutFrame() { 604 OctopusAboutFrame frame = new OctopusAboutFrame(this.desktop); 605 setDefaultCloseOperation(DISPOSE_ON_CLOSE); 606 return frame; 607 } 608 609 private class OctopusAboutAction extends AbstractAction { 610 613 public OctopusAboutAction() { 614 putValue(NAME, "About"); 615 putValue( 616 SMALL_ICON, 617 new ImageIcon ( 618 getClass().getClassLoader().getResource( 619 "org/webdocwf/util/loader/" + "wizard/images/About16.gif"))); 620 putValue(SHORT_DESCRIPTION, "About the program"); 621 putValue(LONG_DESCRIPTION, "About the program"); 622 putValue( 623 ACCELERATOR_KEY, 624 KeyStroke.getKeyStroke('A', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 625 putValue(MNEMONIC_KEY, new Integer ('A')); 626 } 627 628 632 public void actionPerformed(ActionEvent e) { 633 try { 634 OctopusAboutFrame aboutFrame = createOctopusAboutFrame(); 635 desktop.add(aboutFrame); 638 aboutFrame.setVisible(true); 639 640 } catch (Exception ex) { 641 String message = 642 "Error while creating action for OctopusAbout menu item. Message :" 643 + ex.getMessage(); 644 JOptionPane.showMessageDialog(desktop, message + "\n", "Error", 0); 645 System.exit(0); 646 } 647 } 648 } 649 650 private void setLoaderData(OctopusProperties properties, OctopusLoaderData loaderData) throws Exception { 651 try { 652 loaderData.setAdditionalPaths(properties.getOctopusProperty("Loader.AdditionalPaths")); 653 loaderData.setCommitCount(properties.getOctopusProperty("Loader.CommitCount")); 654 loaderData.setConfJarStructure(properties.getOctopusProperty("Loader.ConfJarStructure")); 655 loaderData.setIncludeTables(properties.getOctopusProperty("Loader.IncludeTables")); 656 loaderData.setLogFileDir(properties.getOctopusProperty("Loader.LogFileDir")); 657 loaderData.setLogFileName(properties.getOctopusProperty("Loader.LogFileName")); 658 loaderData.setLogMode(properties.getOctopusProperty("Loader.LogMode")); 659 loaderData.setOnErrorCon(properties.getOctopusProperty("Loader.ErrorConntinue")); 660 loaderData.setPathToXml(properties.getOctopusProperty("Loader.PathToXml")); 661 loaderData.setRestartIndicator(properties.getOctopusProperty("Loader.RestartIndicator")); 662 loaderData.setReturnCode(properties.getOctopusProperty("Loader.ReturnCode")); 663 loaderData.setUserId(properties.getOctopusProperty("Loader.UserId")); 664 loaderData.setVariables(properties.getOctopusProperty("Loader.Variables")); 665 loaderData.setVendorConf(properties.getOctopusProperty("Loader.VendorConf")); 666 }catch(Exception e) { 667 throw e; 668 } 669 } 670 671 private void setGeneratorData(OctopusProperties properties, OctopusGeneratorData generatorData) throws Exception { 672 try { 673 generatorData.setAdditionalPaths(properties.getOctopusProperty("Generator.AdditionalPaths")); 674 generatorData.setConfJarStructure(properties.getOctopusProperty("Generator.ConfJarStructure")); 675 generatorData.setDomlGenerate(properties.getOctopusProperty("Generator.DomlGenerate")); 676 generatorData.setDomlPath(properties.getOctopusProperty("Generator.DomlPath")); 677 generatorData.setFullMode(properties.getOctopusProperty("Generator.FullMode")); 678 generatorData.setGeneratorOutput(properties.getOctopusProperty("Generator.GeneratorOutput")); 679 generatorData.setIncludeTableList(properties.getOctopusProperty("Generator.IncludeTableList")); 680 generatorData.setPackageName(properties.getOctopusProperty("Generator.PackageName")); 681 generatorData.setSourceDatabase(properties.getOctopusProperty("Generator.SourceDatabase")); 682 generatorData.setSourceDriverName(properties.getOctopusProperty("Generator.SourceDriverName")); 683 generatorData.setSourcePassword(properties.getOctopusProperty("Generator.SourcePassword")); 684 generatorData.setSourceType(properties.getOctopusProperty("Generator.SourceType")); 685 generatorData.setSourceUser(properties.getOctopusProperty("Generator.SourceUser")); 686 generatorData.setSqlGenerate(properties.getOctopusProperty("Generator.SqlGenerate")); 687 generatorData.setSqlStmtCreateFK(properties.getOctopusProperty("Generator.SqlStmtCreateFK")); 688 generatorData.setSqlStmtCreateIndex(properties.getOctopusProperty("Generator.SqlStmtCreateIndex")); 689 generatorData.setSqlStmtCreatePK(properties.getOctopusProperty("Generator.SqlStmtCreatePK")); 690 generatorData.setSqlStmtCreateTable(properties.getOctopusProperty("Generator.SqlStmtCreateTable")); 691 generatorData.setSqlStmtDropIntegrity(properties.getOctopusProperty("Generator.SqlStmtDropIntegrity")); 692 generatorData.setSqlStmtDropTable(properties.getOctopusProperty("Generator.SqlStmtDropTable")); 693 generatorData.setSqlStmtForAllVendors(properties.getOctopusProperty("Generator.SqlStmtForAllVendors")); 694 generatorData.setTargetDatabase(properties.getOctopusProperty("Generator.TargetDatabase")); 695 generatorData.setTargetDriverName(properties.getOctopusProperty("Generator.TargetDriverName")); 696 generatorData.setTargetPassword(properties.getOctopusProperty("Generator.TargetPassword")); 697 generatorData.setTargetType(properties.getOctopusProperty("Generator.TargetType")); 698 generatorData.setTargetUser(properties.getOctopusProperty("Generator.TargetUser")); 699 generatorData.setValueMode(properties.getOctopusProperty("Generator.ValueMode")); 700 generatorData.setXmlGenerate(properties.getOctopusProperty("Generator.XmlGenerate")); 701 702 generatorData.setLogMode(properties.getOctopusProperty("Generator.LogMode")); 703 generatorData.setLogFileDir(properties.getOctopusProperty("Generator.LogFileDir")); 704 generatorData.setLogFileName(properties.getOctopusProperty("Generator.LogFileName")); 705 }catch(Exception e) { 706 throw e; 707 } 708 } 709 710 711 } | Popular Tags |