Exemple #1
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
   }
 }
Exemple #2
0
 public void onResponseReceived(Request request, Response response) {
   waitingForResponse = false;
   if (finished == true && !uploading) {
     updateStatusTimer.cancel();
     return;
   }
   parseAjaxResponse(response.getText());
 }