Package nz.govt.natlib.meta.config

Examples of nz.govt.natlib.meta.config.Configuration


      }
    });
    destinationText.getDocument().addDocumentListener(
        new DocumentListener() {
          public void changeProperty() {
            Configuration config = (Configuration) configSelect
                .getSelectedItem();
            config.setOutputDirectory(destinationText.getText());
          }

          public void changedUpdate(DocumentEvent evt) {
            changeProperty();
          }
View Full Code Here


  }

  public void harvest() {
    LogManager.getInstance().logMessage(LogMessage.WORTHLESS_CHATTER,
        "Harvesting");
    Configuration config = (Configuration) configSelect.getSelectedItem();
    Runnable runnable = new HarvestProcess(this, fileTree, config);
    Thread t = new Thread(runnable);
    t.setPriority(Thread.MIN_PRIORITY);
    t.start();
  }
View Full Code Here

    }
  }

  void showConfig() {
    // putup the description
    Configuration config = (Configuration) configSelect.getSelectedItem();
    destinationText.setText(config.getOutputDirectory());
    LogManager.getInstance().logMessage(LogMessage.WORTHLESS_CHATTER,
        "Setting configuration to: " + config.getName());
  }
View Full Code Here

    try {
      // Create a HarvestSource of the object we want to harvest.
      FileHarvestSource source = new FileHarvestSource(file);
     
      // Get the native Configuration.
      Configuration c = Config.getInstance().getConfiguration("Extract in Native form");
     
      // Harvest the file. Note that the output is sent to a file as
      // specified in the configuration. This class produces very little
      // in the way of direct output.
      c.getHarvester().harvest(c, source, new PropsManager());
     
      // Get the NLNZ Data Dictionary configuration.
      c = Config.getInstance().getConfiguration("NLNZ Data Dictionary");
     
      // Harvest the file. Note that the output is sent to a file as
      // specified in the configuration. This class produces very little
      // in the way of direct output.
      c.getHarvester().harvest(c, source, new PropsManager());
     
      System.out.println("Harvest Completed Successfully");
    }
    catch(ConfigurationException ex) {
      // Exception initialising the harvester.
View Full Code Here

    }

    // find the config requested
    ArrayList configs = Config.getInstance().getAvailableConfigs();
    Iterator it = configs.iterator();
    Configuration configuration = null;
    while (it.hasNext()) {
      Configuration c = (Configuration) it.next();
      if (c.getName().equalsIgnoreCase(config)) {
        configuration = c;
      }
    }
    if (prof != null) {
      handled = true;
View Full Code Here

    if (CONFIG_PARAM.equalsIgnoreCase(param)) {
      System.out.println("Available Configurations");
      ArrayList configs = Config.getInstance().getAvailableConfigs();
      Iterator it = configs.iterator();
      while (it.hasNext()) {
        Configuration c = (Configuration) it.next();
        System.out.println("  Config:");
        System.out.println("    Name: " + c.getName());
        System.out.println("    Output Directory: "
            + c.getOutputDirectory());
        System.out.println("    Output DTD: " + c.getOutputDTD());
      }
      handled = true;
    } else if (PROFILE_PARAM.equalsIgnoreCase(param)) {
      System.out.println("Available Profiles");
      ArrayList profiles = Config.getInstance().getAvailableProfiles();
View Full Code Here

    if (dlg.showDialog()) {
      String name = dlg.getConfigurationName();
      String className = dlg.getConfigurationClass();
      String outputDTD = dlg.getOutputDtd();
      String outputDir = dlg.getOutputDir();
      Configuration config = new Configuration(name, className,
          outputDir, outputDTD);
      tableModel.addConfiguration(config);
      Config.getEditInstance().addConfig(config);
      configTable.setRowSelectionInterval(tableModel.getRowCount() - 1,
          tableModel.getRowCount() - 1);
View Full Code Here

  }

  private void delConfig() {
    int idx = configTable.getSelectedRow();
    if (idx > -1) {
      Configuration config = tableModel.removeConfiguration(idx);
      Config.getEditInstance().removeConfig(config);
      if (tableModel.getRowCount() > 0) {
        int sel = Math.max(Math.min(idx, tableModel.getRowCount() - 1),
            0);
        configTable.setRowSelectionInterval(sel, sel);
      }
      LogManager.getInstance().logMessage(LogMessage.INFO,
          "Configuration removed: " + config.getName());
    }
  }
View Full Code Here

      this.fireTableDataChanged();
    }

    public Configuration removeConfiguration(int index) {
      if (index < configList.size()) {
        Configuration config = (Configuration) configList.get(index);
        configList.remove(index);
        fireTableDataChanged();
        return config;
      }
      return null;
View Full Code Here

    public int getColumnCount() {
      return 4;
    }

    public Object getValueAt(int row, int col) {
      Configuration config = (Configuration) configList.get(row);
      switch (col) {
      case 0:
        return config.getName();
      case 1:
        return config.getClassName();
      case 2:
        return config.getOutputDirectory();
      case 3:
        return config.getOutputDTD();
      default:
        return null;
      }
    }
View Full Code Here

TOP

Related Classes of nz.govt.natlib.meta.config.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.