Example #1
0
  @Override
  protected void onBind() {
    super.onBind();
    csvFormatStepPresenter.bind();
    xmlFormatStepPresenter.bind();
    spssFormatStepPresenter.bind();
    limesurveyStepPresenter.bind();
    restStepPresenter.bind();
    comparedDatasourcesReportPresenter.bind();

    comparedDatasourcesReportPresenter.allowIgnoreAllModifications(false);

    setInSlot(Slots.Destination, destinationSelectionStepPresenter);
    setInSlot(Slots.Unit, unitSelectionStepPresenter);
    setInSlot(Slots.Values, datasourceValuesStepPresenter);
    setInSlot(Slots.Archive, archiveStepPresenter);
    setInSlot(Slots.Limesurvey, limesurveyStepPresenter);
    setInSlot(Slots.Rest, restStepPresenter);

    getView().setUnitSelectionStepInHandler(new UnitSelectionStepInHandler());
    getView().setComparedDatasourcesReportDisplay(comparedDatasourcesReportPresenter.getView());
    getView()
        .setComparedDatasourcesReportStepInHandler(
            transientDatasourceHandler = new TransientDatasourceHandler());
    getView().setDatasourceValuesStepInHandler(new DatasourceValuesHandler());

    addEventHandlers();
  }
Example #2
0
 private ImportCommandOptionsDto createImportCommandOptionsDto(@Nullable String selectedFile) {
   ImportCommandOptionsDto dto = ImportCommandOptionsDto.create();
   dto.setDestination(importConfig.getDestinationDatasourceName());
   if (importConfig.isArchiveMove()) {
     dto.setArchive(importConfig.getArchiveDirectory());
     JsArrayString selectedFiles = JavaScriptObject.createArray().cast();
     selectedFiles.push(selectedFile);
     dto.setFilesArray(selectedFiles);
   }
   if (importConfig.isIdentifierSharedWithUnit()) {
     dto.setUnit(importConfig.getUnit());
     dto.setForce(false);
     dto.setIgnore(true);
   }
   JsArrayString selectedTables = JavaScriptObject.createArray().cast();
   for (String tableName : comparedDatasourcesReportPresenter.getSelectedTables()) {
     selectedTables.push(importConfig.getTransientDatasourceName() + "." + tableName);
   }
   dto.setTablesArray(selectedTables);
   return dto;
 }