Package org.geomajas.command.dto

Examples of org.geomajas.command.dto.SearchByLocationResponse


    LineString equator = factory.createLineString(new Coordinate[] {new Coordinate(0, 0),
        new Coordinate(-180, 180)});
    request.setLocation(converter.toDto(equator));

    // execute
    SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
        SearchByLocationRequest.COMMAND, request, null, "en");

    // test
    Assert.assertFalse(response.isError());
    List<Feature> features = response.getFeatureMap().get(LAYER_ID);
    Assert.assertNotNull(features);
    Assert.assertEquals(4, features.size());
    List<String> actual = new ArrayList<String>();
    for (Feature feature : features) {
      actual.add(feature.getLabel());
View Full Code Here


    LineString equator = factory.createLineString(new Coordinate[] {new Coordinate(0, 0),
        new Coordinate(-180, 180)});
    request.setLocation(converter.toDto(equator));

    // execute
    SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
        SearchByLocationRequest.COMMAND, request, null, "en");

    // test
    Assert.assertFalse(response.isError());
    List<Feature> features = response.getFeatureMap().get(LAYER_ID);
    Assert.assertNotNull(features);
    Assert.assertEquals(2, features.size());
    List<String> actual = new ArrayList<String>();
    for (Feature feature : features) {
      actual.add(feature.getLabel());
View Full Code Here

    LineString equator = factory.createLineString(new Coordinate[] {new Coordinate(0, 0),
        new Coordinate(-180, 180)});
    request.setLocation(converter.toDto(equator));

    // execute
    SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
        SearchByLocationRequest.COMMAND, request, null, "en");

    // test
    Assert.assertFalse(response.isError());
    List<Feature> features = response.getFeatureMap().get(LAYER_ID);
    Assert.assertNotNull(features);
    Assert.assertEquals(2, features.size());
    List<String> actual = new ArrayList<String>();
    for (Feature feature : features) {
      actual.add(feature.getLabel());
View Full Code Here

        new Coordinate(1, 0.5), new Coordinate(0, 0.5), new Coordinate(0, 0)});
    Polygon polygon = factory.createPolygon(half1, null);
    request.setLocation(converter.toDto(polygon));

    // execute
    SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
        SearchByLocationRequest.COMMAND, request, null, "en");

    // test
    Assert.assertFalse(response.isError());
    List<Feature> features = response.getFeatureMap().get(LAYER_ID);
    Assert.assertNotNull(features);
    List<String> actual = new ArrayList<String>();
    for (Feature feature : features) {
      actual.add(feature.getLabel());
    }
View Full Code Here

        new Coordinate(1, 0.49), new Coordinate(0, 0.49), new Coordinate(0, 0)});
    Polygon polygon = factory.createPolygon(half1, null);
    request.setLocation(converter.toDto(polygon));

    // execute
    SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
        SearchByLocationRequest.COMMAND, request, null, "en");
    // test
    List<Feature> features = response.getFeatureMap().get(LAYER_ID);
    Assert.assertNull(features);
  }
View Full Code Here

      } else {
        features = result.getFeatures();
      }
    } else if (request.getSearchByLocationRequest() != null) {
      log.debug("CSV export using LocationRequest");
      SearchByLocationResponse result = (SearchByLocationResponse) dispatch.execute(
          SearchByLocationRequest.COMMAND, request.getSearchByLocationRequest(), token, locale);
      if (result.isError()) {
        response.getErrorMessages().addAll(result.getErrorMessages());
        response.getErrors().addAll(result.getErrors());
      } else {
        List<Feature> res = result.getFeatureMap().get(request.getLayerId());
        if (res != null) {
          features = res.toArray(new Feature[res.size()]);
        } else {
          features = new Feature[0];
        }
      }
    } else if (request.getSearchByCriterionRequest() != null) {
      log.debug("CSV export using CriterionRequest");
      FeatureSearchResponse result = (FeatureSearchResponse) dispatch.execute(FeatureSearchRequest.COMMAND,
          request.getSearchByCriterionRequest(), token, locale);
      if (result.isError()) {
        response.getErrorMessages().addAll(result.getErrorMessages());
        response.getErrors().addAll(result.getErrors());
      } else {
        List<Feature> res = result.getFeatureMap().get(request.getLayerId());
        if (res != null) {
          features = res.toArray(new Feature[res.size()]);
        } else {
          features = new Feature[0];
        }
View Full Code Here

    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<org.geomajas.layer.feature.Feature>> featureMap = response.getFeatureMap();
          for (String serverLayerId : featureMap.keySet()) {
            List<VectorLayer> layers = mapWidget.getMapModel().getVectorLayersByServerId(serverLayerId);
            for (VectorLayer vectorLayer : layers) {
              List<org.geomajas.layer.feature.Feature> orgFeatures = featureMap.get(serverLayerId);
              if (orgFeatures.size() > 0) {
View Full Code Here

    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {
      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<org.geomajas.layer.feature.Feature>> featureMap = response.getFeatureMap();
          featureCache.clear();
          for (String serverLayerId : featureMap.keySet()) {
            VectorLayer vl = findLayer(serverLayerId);
            List<Feature> features = new ArrayList<Feature>();
            featureCache.put(vl, features);
View Full Code Here

    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback<CommandResponse>() {

      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<org.geomajas.layer.feature.Feature>> featureMap = response.getFeatureMap();
          for (String layerId : featureMap.keySet()) {
            selectFeatures(layerId, featureMap.get(layerId));
          }
        }
      }
View Full Code Here

    request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback<CommandResponse>() {
      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<Feature>> featureMap = response.getFeatureMap();
          for (String layerId : featureMap.keySet()) {
            selectFeatures(layerId, featureMap.get(layerId), singleSelectionId);
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.geomajas.command.dto.SearchByLocationResponse

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.