Package ch.tatool.export

Examples of ch.tatool.export.DataExporter


    if (exporters.size() > 0) {
      Iterator<String> it = exporters.keySet().iterator();
      while(it.hasNext()) {
        final String exporterKey = it.next();
        DataExporter ex = exporters.get(exporterKey);
        // get last export date while we're scanning through
        if (dataExportService.getLastExportDate(module, exporterKey) == null) {
        } else if (lastExportDate == null) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        } else if (dataExportService.getLastExportDate(module, exporterKey).after(lastExportDate)) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        }
        JButton exportButton = new JButton();
        exportButton.setFont(new Font("Tahoma", 0, 13)); //$NON-NLS-1$
        exportButton.setText(ex.getExporterName());
        exportButton.setMaximumSize(new Dimension(109, 25));
        exportButton.setMinimumSize(new Dimension(109, 25));
        exportButton.setPreferredSize(new Dimension(109, 25));
            exportButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
View Full Code Here


      updateUI();
      if (exporters != null) {
        Iterator<String> it = exporters.keySet().iterator();
        while(it.hasNext()) {
          final String exporterKey = it.next();
          DataExporter ex = exporters.get(exporterKey);
          if (ex.isAutoExport()) {
            exportData(exporterKey);
          }
        }
      }
     
View Full Code Here

    return lastExportDate;
    }

    public String exportData(Component parent, Module module, String exporterKey) {
     
      DataExporter exporter = module.getModuleExporter(exporterKey);
     
      // check whether we got an exporter class defined
        if (exporter == null) {
          throw new RuntimeException("Exporter not found");
        }

        if (exporter.getDataService() == null) {
          exporter.setDataService(dataService);
        }
       
        dataService.setMessages(messages);
        exporter.setMessages(messages);
       
        // session index to export from
        int fromSessionIndex = -1;
       
        // check whether we should export incrementally
        boolean incremental = exporter.isIncrementalExport();
        if (incremental) {
            // find out about the last exported session index
            String s = module.getModuleProperties().get(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION);
            if (s != null) {
                try {
                    fromSessionIndex = Integer.parseInt(s);
                    fromSessionIndex++;
                } catch (NumberFormatException nfe) {
                    logger.warn("Unable to cast last session index to a number. Exporting all sessions", nfe);
                }
            }
        }
       
        // now perform the export
        DataExporterErrorImpl exporterError = new DataExporterErrorImpl();
        exporterError.setMessages(messages);
        try {
          exporter.exportData(parent, module, fromSessionIndex, exporterError);
          if (exporterError.getErrorType() != 0) {
            dataService.saveModule(module);
            return exporterError.getErrorMessage();
          }
            // update the export information
View Full Code Here

    return lastExportDate;
    }

    public String exportData(Component parent, Module module, String exporterKey) {
     
      DataExporter exporter = module.getModuleExporter(exporterKey);
     
      // check whether we got an exporter class defined
        if (exporter == null) {
          throw new RuntimeException("Exporter not found");
        }

        if (exporter.getDataService() == null) {
          exporter.setDataService(dataService);
        }
       
        dataService.setMessages(messages);
       
        // session index to export from
        int fromSessionIndex = -1;
       
        // check whether we should export incrementally
        boolean incremental = exporter.isIncrementalExport();
        if (incremental) {
            // find out about the last exported session index
            String s = module.getModuleProperties().get(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION);
            if (s != null) {
                try {
                    fromSessionIndex = Integer.parseInt(s);
                    fromSessionIndex++;
                } catch (NumberFormatException nfe) {
                    logger.warn("Unable to cast last session index to a number. Exporting all sessions", nfe);
                }
            }
        }
       
        // now perform the export
        DataExporterErrorImpl exporterError = new DataExporterErrorImpl();
        exporterError.setMessages(messages);
        try {
          exporter.exportData(parent, module, fromSessionIndex, exporterError);
          if (exporterError.getErrorType() != 0) {
            dataService.saveModule(module);
            return exporterError.getErrorMessage();
          }
            // update the export information
View Full Code Here

    return lastExportDate;
    }

    public String exportData(Component parent, Module module, String exporterKey) {
     
      DataExporter exporter = module.getModuleExporter(exporterKey);
     
      // check whether we got an exporter class defined
        if (exporter == null) {
          throw new RuntimeException("Exporter not found");
        }

        if (exporter.getDataService() == null) {
          exporter.setDataService(dataService);
        }
       
        dataService.setMessages(messages);
       
        // session index to export from
        int fromSessionIndex = -1;
       
        // check whether we should export incrementally
        boolean incremental = exporter.isIncrementalExport();
        if (incremental) {
            // find out about the last exported session index
            String s = module.getModuleProperties().get(exporterKey + "." + DataExportService.PROPERTY_LAST_EXPORTED_SESSION);
            if (s != null) {
                try {
                    fromSessionIndex = Integer.parseInt(s);
                    fromSessionIndex++;
                } catch (NumberFormatException nfe) {
                    logger.warn("Unable to cast last session index to a number. Exporting all sessions", nfe);
                }
            }
        }
       
        // now perform the export
        String error = null;
        DataExporterErrorImpl exporterError = new DataExporterErrorImpl();
        exporterError.setMessages(messages);
        try {
          error = exporter.exportData(parent, module, fromSessionIndex, exporterError);
          if (exporterError.getErrorType() != 0) {
            dataService.saveModule(module);
            return exporterError.getErrorMessage();
          }
            // update the export information
View Full Code Here

    if (exporters.size() > 0) {
      Iterator<String> it = exporters.keySet().iterator();
      while(it.hasNext()) {
        final String exporterKey = it.next();
        DataExporter ex = exporters.get(exporterKey);
        // get last export date while we're scanning through
        if (dataExportService.getLastExportDate(module, exporterKey) == null) {
        } else if (lastExportDate == null) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        } else if (dataExportService.getLastExportDate(module, exporterKey).after(lastExportDate)) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        }
        JButton exportButton = new JButton();
        exportButton.setFont(new Font("Tahoma", 0, 13)); //$NON-NLS-1$
        exportButton.setText(ex.getExporterName());
        exportButton.setMaximumSize(new Dimension(109, 25));
        exportButton.setMinimumSize(new Dimension(109, 25));
        exportButton.setPreferredSize(new Dimension(109, 25));
            exportButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
View Full Code Here

      updateUI();
      if (exporters != null) {
        Iterator<String> it = exporters.keySet().iterator();
        while(it.hasNext()) {
          final String exporterKey = it.next();
          DataExporter ex = exporters.get(exporterKey);
          if (ex.isAutoExport()) {
            exportData(exporterKey);
          }
        }
      }
     
View Full Code Here

    if (exporters.size() > 0) {
      Iterator<String> it = exporters.keySet().iterator();
      while(it.hasNext()) {
        final String exporterKey = it.next();
        DataExporter ex = exporters.get(exporterKey);
        // get last export date while we're scanning through
        if (dataExportService.getLastExportDate(module, exporterKey) == null) {
        } else if (lastExportDate == null) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        } else if (dataExportService.getLastExportDate(module, exporterKey).after(lastExportDate)) {
          lastExportDate = dataExportService.getLastExportDate(module, exporterKey);
        }
        JButton exportButton = new JButton();
        exportButton.setFont(new Font("Tahoma", 0, 13)); //$NON-NLS-1$
        exportButton.setText(ex.getExporterName());
        exportButton.setMaximumSize(new Dimension(109, 25));
        exportButton.setMinimumSize(new Dimension(109, 25));
        exportButton.setPreferredSize(new Dimension(109, 25));
            exportButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
View Full Code Here

      updateUI();
      if (exporters != null) {
        Iterator<String> it = exporters.keySet().iterator();
        while(it.hasNext()) {
          final String exporterKey = it.next();
          DataExporter ex = exporters.get(exporterKey);
          if (ex.isAutoExport()) {
            exportData(exporterKey);
          }
        }
      }
     
View Full Code Here

TOP

Related Classes of ch.tatool.export.DataExporter

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.