예제 #1
0
  private void reviewCompleted(
      final MyDialog popup, final CreateOntologyResult createOntologyResult) {
    String error = createOntologyResult.getError();

    //  Issue 211: Remove unnecesary registration confirmation dialogs
    if (error == null) {
      doRegister(popup, createOntologyResult);
      return;
    }

    StringBuffer sb = new StringBuffer();

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(4);
    sb.append(error);

    String msg = sb.toString();

    popup.getTextArea().setText(msg);
    popup.getDockPanel().add(vp, DockPanel.NORTH);
    popup.setText(error == null ? "Ontology ready to be registered" : "Error");
    popup.center();

    Orr.log(CLASS_NAME + ": Review result: " + msg);
  }
예제 #2
0
  private void registrationCompleted(
      MyDialog registrationPopup, final RegisterOntologyResult uploadOntologyResult) {

    registrationPopup.hide();

    String error = uploadOntologyResult.getError();

    StringBuffer sb = new StringBuffer();

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(6);

    if (error == null) {

      String uri = uploadOntologyResult.getUri();

      vp.add(
          new HTML(
              "<font color=\"green\">Congratulations!</font> "
                  + "Your ontology is now registered."));

      vp.add(
          new HTML(
              "<br/>The URI of the ontology is: "
                  //					+ "<a href=\"" +uri+ "\">"
                  + uri
              //					+ "</a>"
              ));

      vp.add(new HTML("<br/>For diagnostics, this is the response from the back-end server:"));

      sb.append(uploadOntologyResult.getInfo());

      // and, disable all editing fields/buttons:
      // (user will have to start from the "load" step)
      //			enable(false);
    } else {
      sb.append(error);
    }

    String msg = sb.toString();
    Orr.log(CLASS_NAME + ": Registration result: " + msg);

    final MyDialog popup = new MyDialog(null);
    popup.setCloseButtonText("Return to ontology list");
    popup.setText(error == null ? "Registration completed sucessfully" : "Error");
    popup.addTextArea(null).setText(msg);
    popup.getTextArea().setSize("600", "150");

    popup.getDockPanel().add(vp, DockPanel.NORTH);
    popup.center();

    popup.addPopupListener(
        new PopupListener() {
          public void onPopupClosed(PopupPanel sender, boolean autoClosed) {
            PortalControl.getInstance().completedRegisterOntologyResult(uploadOntologyResult);
          }
        });
    popup.show();
  }