/** * Add a command and it's callbacks to the list of commands to retry after login. * * @param command * command to retry * @param deferred * callbacks for the command */ private void afterLogin(GwtCommand command, Deferred deferred) { String token = notNull(command.getUserToken()); if (!afterLoginCommands.containsKey(token)) { afterLoginCommands.put(token, new ArrayList<RetryCommand>()); } afterLoginCommands.get(token).add(new RetryCommand(command, deferred)); }
/** * Method which forces retry of a command after login. * <p/> * This method assumes the single threaded nature of JavaScript execution for correctness. * * @param command * command which needs to be retried * @param deferred * callbacks for the command */ private void handleLogin(GwtCommand command, Deferred deferred) { final String oldToken = notNull(command.getUserToken()); if (!afterLoginCommands.containsKey(oldToken)) { afterLoginCommands.put(oldToken, new ArrayList<RetryCommand>()); login(oldToken); } afterLogin(command, deferred); }
/** * Execute a GWT RPC command request, and return the response. These request come from the client, and the response * is sent back to the client. We use a {@link CommandDispatcher} to actually execute the command. */ public CommandResponse execute(GwtCommand request) { if (request != null) { return commandDispatcher.execute(request.getCommandName(), request.getCommandRequest(), request.getUserToken(), request.getLocale()); } return null; }
/** * Execute a GWT RPC command request, and return the response. These request come from the client, and the response * is sent back to the client. We use a {@link CommandDispatcher} to actually execute the command. */ public CommandResponse execute(GwtCommand request) { if (request != null) { return commandDispatcher.execute(request.getCommandName(), request.getCommandRequest(), request.getUserToken(), request.getLocale()); } return null; }
authenticationFailed |= SECURITY_EXCEPTION_CLASS_NAME.equals(exception.getClassName()) && (ExceptionCode.CREDENTIALS_MISSING_OR_INVALID == exception.getExceptionCode() || isUndefinedToken(command.getUserToken()));
public void execute(PrintGetTemplateResponse response) { UrlBuilder url = new UrlBuilder(GWT.getHostPageBaseURL()); url.addPath(URL_PATH); url.addParameter(URL_DOCUMENT_ID, response.getDocumentId()); // url.addParameter(URL_NAME, (String) fileNameItem.getValue()); url.addParameter(URL_NAME, "mapPrinting.pdf"); url.addParameter(URL_TOKEN, command.getUserToken()); // TODO String downloadType = downloadTypeGroup.getValue() String downloadType = OPEN; if (SAVE.equals(downloadType)) { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_YES); // TODO Converted to pureGWT // String encodedUrl = url.toString(); // // create a hidden iframe to avoid popups ??? // HTMLPanel hiddenFrame = new HTMLPanel("<iframe src='" + encodedUrl // + "'+style='position:absolute;width:0;height:0;border:0'>"); // hiddenFrame.setVisible(false); // // addChild(hiddenFrame); } else { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_NO); String encodedUrl = url.toString(); com.google.gwt.user.client.Window.open(encodedUrl, "_blank", null); } } });
public void execute(PrintGetTemplateResponse response) { stopProgress(); UrlBuilder url = new UrlBuilder(GWT.getHostPageBaseURL()); url.addPath(URL_PATH); url.addParameter(URL_DOCUMENT_ID, response.getDocumentId()); url.addParameter(URL_NAME, (String) fileNameItem.getValue()); url.addParameter(URL_TOKEN, command.getUserToken()); if (SAVE.equals(downloadTypeGroup.getValue())) { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_YES); String encodedUrl = url.toString(); // create a hidden iframe to avoid popups ??? HTMLPanel hiddenFrame = new HTMLPanel("<iframe src='" + encodedUrl + "'+style='position:absolute;width:0;height:0;border:0'>"); hiddenFrame.setVisible(false); addChild(hiddenFrame); } else { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_NO); String encodedUrl = url.toString(); com.google.gwt.user.client.Window.open(encodedUrl, "_blank", null); } } });
public void execute(PrintGetTemplateResponse response) { stopProgress(); UrlBuilder url = new UrlBuilder(Geomajas.getDispatcherUrl()); url.addPath(DISPATCHING_SERVICE); url.addParameter(URL_DOCUMENT_ID, response.getDocumentId()); url.addParameter(URL_NAME, (String) fileNameItem.getValue()); url.addParameter(URL_TOKEN, command.getUserToken()); if (SAVE.equals(downloadTypeGroup.getValue())) { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_YES); String encodedUrl = url.toString(); // create a hidden iframe to avoid popups ??? HTMLPanel hiddenFrame = new HTMLPanel("<iframe src='" + encodedUrl + "'+style='position:absolute;width:0;height:0;border:0'>"); hiddenFrame.setVisible(false); addChild(hiddenFrame); } else { url.addParameter(URL_DOWNLOAD, URL_DOWNLOAD_NO); String encodedUrl = url.toString(); com.google.gwt.user.client.Window.open(encodedUrl, "_blank", null); } } });