Beispiel #1
0
  /**
   * A convenient method for view the ASpace json records. It meant to be used for development
   * purposes only
   */
  private void viewRecordButtonActionPerformed() {
    String uri = recordURIComboBox.getSelectedItem().toString();
    String recordJSON = "";

    try {
      if (aspaceClient == null) {
        String host = hostTextField.getText().trim();
        String admin = adminTextField.getText();
        String adminPassword = adminPasswordTextField.getText();

        aspaceClient = new ASpaceClient(host, admin, adminPassword);
        aspaceClient.getSession();
      }

      recordJSON = aspaceClient.getRecordAsJSONString(uri, paramsTextField.getText());

      if (recordJSON == null || recordJSON.isEmpty()) {
        recordJSON = aspaceClient.getErrorMessages();
      }
    } catch (Exception e) {
      recordJSON = e.toString();
    }

    CodeViewerDialog codeViewerDialog =
        new CodeViewerDialog(this, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, recordJSON, true, true);
    codeViewerDialog.setTitle("REST ENDPOINT URI: " + uri);
    codeViewerDialog.pack();
    codeViewerDialog.setVisible(true);
  }
Beispiel #2
0
  /** Method to copy data from AT to archive space. NO longer Used */
  private void CopyToASpaceButtonActionPerformed() {
    // reset the error count and error messages
    errorCountLabel.setText("N/A");
    migrationErrors = "";

    // try loading the excel file here
    try {
      String fileName = excelTextField.getText();

      FileInputStream fileInputStream = new FileInputStream(fileName);

      // try loading the work book
      XSSFWorkbook workBook = new XSSFWorkbook(fileInputStream);

      consoleTextArea.append("Loading excel file " + fileName + "\n\n");

      // now call the method to that will actually start the copy process
      startASpaceCopyProcess(workBook);
    } catch (Exception e) {
      consoleTextArea.append("Error loading excel file\n\n");
      e.printStackTrace();
    }
  }