Package org.geomajas.gwt.client.command

Examples of org.geomajas.gwt.client.command.GwtCommand


   * @param onFinished
   */
  public static void saveSearchFavourite(SearchFavourite sf, final DataCallback<SearchFavourite> onFinished) {
    SaveSearchFavouriteRequest ssfr = new SaveSearchFavouriteRequest();
    ssfr.setSearchFavourite(sf);
    GwtCommand command = new GwtCommand(SaveSearchFavouriteRequest.COMMAND);
    command.setCommandRequest(ssfr);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof SaveSearchFavouriteResponse) {
          SaveSearchFavouriteResponse resp = (SaveSearchFavouriteResponse) response;
          if (onFinished != null) {
View Full Code Here


  }

  public static void deleteSearchFavourite(SearchFavourite sf, final DataCallback<Boolean> onFinished) {
    DeleteSearchFavouriteRequest dsfr = new DeleteSearchFavouriteRequest();
    dsfr.setSearchFavouriteId(sf.getId());
    GwtCommand command = new GwtCommand(DeleteSearchFavouriteRequest.COMMAND);
    command.setCommandRequest(dsfr);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof SuccessCommandResponse) {
          SuccessCommandResponse resp = (SuccessCommandResponse) response;
          if (onFinished != null) {
View Full Code Here

    request.setActionFlags(GeometryUtilsRequest.ACTION_BUFFER | GeometryUtilsRequest.ACTION_MERGE);
    request.setIntermediateResults(true);
    request.setBuffer(buffer);
    request.setGeometries(toDtoGeometries(geometries));

    GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GeometryUtilsResponse) {
          GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
          if (onFinished != null) {
View Full Code Here

  public static void mergeGeometries(List<Geometry> geometries, final DataCallback<Geometry> onFinished) {
    GeometryUtilsRequest request = new GeometryUtilsRequest();
    request.setActionFlags(GeometryUtilsRequest.ACTION_MERGE);
    request.setGeometries(toDtoGeometries(geometries));

    GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GeometryUtilsResponse) {
          GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
          if (onFinished != null) {
View Full Code Here

    GeometryUtilsRequest request = new GeometryUtilsRequest();
    request.setActionFlags(GeometryUtilsRequest.ACTION_BUFFER);
    request.setGeometries(toDtoGeometries(geometries));
    request.setBuffer(buffer);

    GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GeometryUtilsResponse) {
          GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
          if (onFinished != null) {
View Full Code Here

    request.setMapCrs(mapWidget.getMapModel().getCrs());
    request.setCriterion(criterion);
    request.setLayerFilters(getLayerFiltersForCriterion(criterion, mapWidget.getMapModel()));
    request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());

    GwtCommand commandRequest = new GwtCommand(FeatureSearchRequest.COMMAND);
    commandRequest.setCommandRequest(request);
    Deferred def = GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {
      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof FeatureSearchResponse) {
          FeatureSearchResponse response = (FeatureSearchResponse) commandResponse;
          onFinished.execute(convertFromDto(response.getFeatureMap(),
View Full Code Here

    builder.setWithArrow((Boolean) arrowCheckbox.getValue());
    builder.setWithScaleBar((Boolean) scaleBarCheckbox.getValue());
    builder.setRasterDpi((Integer) rasterDpiSlider.getValue());
    PrintTemplateInfo template = builder.buildTemplate();
    request.setTemplate(template);
    final GwtCommand command = new GwtCommand(PrintGetTemplateRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

      public void execute(CommandResponse r) {
        stopProgress();
        if (r instanceof PrintGetTemplateResponse) {
          PrintGetTemplateResponse response = (PrintGetTemplateResponse) r;
          GWT.log("Downloading " + response.getDocumentId(), null);
          UrlBuilder url = new UrlBuilder(GWT.getHostPageBaseURL());
          url.addPath("d/printing").addParameter("documentId", response.getDocumentId());
          url.addParameter("name", (String) fileNameItem.getValue());
          url.addParameter("userToken", command.getUserToken());
          if ("save".equals(downloadTypeGroup.getValue())) {
            url.addParameter("download", "1");
            String encodedUrl = url.toString();
            // create a hidden iframe to avoid popups ???
            HTMLPanel hiddenFrame = new HTMLPanel("<iframe src='" + encodedUrl
View Full Code Here

      loginUser(userId, password, callback);
    } else if (this.userId.equals(userId)) {
      // Already logged in...
      return;
    } else {
      GwtCommand command = new GwtCommand(logoutCommandName);
      GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

        public void execute(CommandResponse response) {
          if (response instanceof SuccessCommandResponse) {
            SuccessCommandResponse successResponse = (SuccessCommandResponse) response;
View Full Code Here

   *
   * @param callback
   *            A possible callback to be executed when the logout has been done (successfully or not). Can be null.
   */
  public void logout(final BooleanCallback callback) {
    GwtCommand command = new GwtCommand(logoutCommandName);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

      public void execute(CommandResponse response) {
        if (response instanceof SuccessCommandResponse) {
          SuccessCommandResponse successResponse = (SuccessCommandResponse) response;
View Full Code Here

  /** Effectively log in a certain user. */
  private void loginUser(final String userId, final String password, final BooleanCallback callback) {
    LoginRequest request = new LoginRequest();
    request.setLogin(userId);
    request.setPassword(password);
    GwtCommand command = new GwtCommand(loginCommandName);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

      public void execute(CommandResponse response) {
        if (response instanceof LoginResponse) {
          LoginResponse loginResponse = (LoginResponse) response;
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.command.GwtCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.