@Override public void setTokenRequestHandler(TokenRequestHandler tokenRequestHandler) { GwtCommandDispatcher.getInstance().setTokenRequestHandler(tokenRequestHandler); } }
/** * Load the manager application. This will execute the InitializationCommand, and ask to select a valid user if * needed. * * @param tokenRequestHandler * the login handler. */ public void loadManagerApplication(final DeskmanagerTokenRequestHandler tokenRequestHandler) { GwtCommandDispatcher.getInstance().setTokenRequestHandler(tokenRequestHandler); //We execute the getgeodeskscommand because that is only accessible by the manager, we ignore the response. GwtCommand command = new GwtCommand(GetGeodesksRequest.COMMAND); final AbstractCommandCallback<GetGeodesksResponse> callback = new AbstractCommandCallback<GetGeodesksResponse>() { public void execute(GetGeodesksResponse response) { fireGeodeskInitialized(tokenRequestHandler.getProfile()); } }; GwtCommandDispatcher.getInstance().execute(command, callback); }
/** * Load a geodesk. This will execute the InitializationCommand, and ask to select a valid user if needed. * * @param geodeskId * the geodesk to load * @param tokenRequestHandler * the login handler. */ public void loadApplication(String geodeskId, TokenRequestHandler tokenRequestHandler) { GwtCommandDispatcher.getInstance().setTokenRequestHandler(tokenRequestHandler); GwtCommand initializeGeodeskCommand = new GwtCommand(GetConfigurationRequest.COMMAND); final AbstractCommandCallback<GetConfigurationResponse> openLoketCallback = new AbstractCommandCallback<GetConfigurationResponse>() { public void execute(GetConfigurationResponse response) { fireGeodeskInitialized(response); } }; GetConfigurationRequest request = new GetConfigurationRequest(); request.setApplicationId(geodeskId); initializeGeodeskCommand.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(initializeGeodeskCommand, openLoketCallback); }