@UiHandler("uploadForm")
  protected void uploadSubmitComplete(SubmitCompleteEvent event) {
    int status = -1;
    if (event.getResults() != null) {
      status = Integer.parseInt(event.getResults());
    }

    if (status != HttpServletResponse.SC_OK) {
      uploadDialogText.setText("Error code given by server: " + status + ". Please try again.");
      uploadDialog.center();
    }
  }
  /**
   * @see
   *     com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler#onSubmitComplete(com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent)
   */
  @Override
  public void onSubmitComplete(SubmitCompleteEvent event) {
    dialog.destroy();

    UploadResult results = UploadResult.fromResult(event.getResults());
    uploadResult = results;
    if (results.isError()) {
      if (results.getError() != null) {
        notificationService.completeProgressNotification(
            notification.getUuid(),
            i18n.format("upload-ontology-submit.upload-error.title"),
            results.getError());
      } else {
        notificationService.completeProgressNotification(
            notification.getUuid(),
            i18n.format("upload-ontology-submit.upload-error.title"),
            i18n.format("upload-ontology-submit.upload-error.msg"));
      }
    } else {
      notificationService.completeProgressNotification(
          notification.getUuid(),
          i18n.format("upload-ontology-submit.upload-complete.title"),
          i18n.format("upload-ontology-submit.upload-complete.msg"));
      if (completionHandler != null) {
        completionHandler.onImportComplete();
      }
    }
  }
Beispiel #3
0
 public void onSubmitComplete(SubmitCompleteEvent event) {
   updateStatusTimer.cancel();
   onSubmitComplete = true;
   serverRawResponse = event.getResults();
   if (serverRawResponse != null) {
     serverRawResponse =
         serverRawResponse.replaceFirst(
             ".*" + TAG_MSG_START + "([\\s\\S]*?)" + TAG_MSG_END + ".*", "$1");
     serverRawResponse =
         serverRawResponse
             .replace(TAG_MSG_LT, "<")
             .replace(TAG_MSG_GT, ">")
             .replace("&lt;", "<")
             .replaceAll("&gt;", ">")
             .replaceAll("&nbsp;", " ");
   }
   try {
     // Parse the xml and extract UploadedInfos
     Document doc = XMLParser.parse(serverRawResponse);
     // If the server response is a valid xml
     parseAjaxResponse(serverRawResponse);
   } catch (Exception e) {
     log("onSubmitComplete exception parsing response (Check CORS and XML syntax): ", e);
     // Otherwise force an ajax request so as we have not to wait to the timer schedule
     // updateStatusTimer.run(); // how could the upload server response be corrupted ?? This
     // causes an error loop in my project with firefox
   }
 }
Beispiel #4
0
 @UiHandler("itemDataFormPanel")
 void onItemDataFormPanelSubmitComplete(SubmitCompleteEvent event) {
   itemDataFormPanel.reset();
   String result = event.getResults();
   if (result == null || (result.contains("SUCCESS") == false)) {
     Window.alert("Error");
   }
   newMenuItemHandler.onNewMenuItem();
   doNotCreatingItem();
 }
 @Override
 public void onSubmitComplete(SubmitCompleteEvent event) {
   String key = event.getResults();
   if (null != key && key.length() > 0) {
     product.setIconKey(key);
     resetIcon();
   }
   uploaderContainer.clear();
   uploaderContainer.add(new ProductImageUploadPanel(product, this));
 }