Example #1
0
  public Boolean dataSourceExport(DataSourceUI dataSourceUI) throws ServerSideException {
    try {
      RepoxManagerDefault repoxManagerDefault =
          (RepoxManagerDefault) ConfigSingleton.getRepoxContextUtil().getRepoxManager();
      DataSourceContainer dataSourceContainer =
          repoxManagerDefault
              .getDataManager()
              .getDataSourceContainer(dataSourceUI.getDataSourceSet());

      DataSource dataSource = dataSourceContainer.getDataSource();
      dataSource.setExportDir(dataSourceUI.getExportDirectory());

      String recordsPerFile;
      if (dataSourceUI.getRecordsPerFile().equals("All")) recordsPerFile = "-1";
      else recordsPerFile = dataSourceUI.getRecordsPerFile();

      ConfigSingleton.getRepoxContextUtil()
          .getRepoxManager()
          .getDataManager()
          .startExportDataSource(
              dataSourceUI.getDataSourceSet(), recordsPerFile, dataSourceUI.getExportFormat());
    } catch (Exception e) {
      throw new ServerSideException(Util.stackTraceToString(e));
    }
    return true;
  }
Example #2
0
 /**
  * ******************************************************* View Info Side Panel Functions
  * ********************************************************
  */
 private void editPanelInfo(DataSourceUI dataSourceUI) {
   // Only do when visible to enhance performance
   if (viewDsInfoPanel.isExpanded()) {
     DataSetSideViewInfo dataSetViewInfo = new DataSetSideViewInfo();
     dataSetViewInfo.createForm(dataSourceUI);
     viewDsInfoPanel.removeAll();
     viewDsInfoPanel.setLayout(new FitLayout());
     viewDsInfoPanel.add(dataSetViewInfo);
     viewDsInfoPanel.setHeading(
         HarvesterUI.CONSTANTS.viewDataSet()
             + ": "
             + dataSourceUI.getDataSourceSet()
             + " ("
             + HarvesterUI.CONSTANTS.dataProvider()
             + ": "
             + dataSourceUI.getDataSetParent().getName()
             + ")");
   }
 }