Package org.geomajas.command.dto

Examples of org.geomajas.command.dto.PersistTransactionRequest


  @Autowired
  private DtoConverterService dtoConverter;

  @Test
  public void testPersistEmptyTransaction() throws Exception {
    PersistTransactionRequest request = new PersistTransactionRequest();
    request.setCrs(CRS);
    FeatureTransaction featureTransaction = new FeatureTransaction();
    featureTransaction.setLayerId(LAYER_ID);
    request.setFeatureTransaction(featureTransaction);
    PersistTransactionResponse response = (PersistTransactionResponse) dispatcher.execute(
        PersistTransactionRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
View Full Code Here


  }

  @Test
  @DirtiesContext // adding a bean
  public void testPersistAddFeatureTransaction() throws Exception {
    PersistTransactionRequest request = new PersistTransactionRequest();
    request.setCrs(CRS);
    FeatureTransaction featureTransaction = new FeatureTransaction();
    featureTransaction.setLayerId(LAYER_ID);
    Feature feature = new Feature();
    GeometryFactory factory = new GeometryFactory();
    Geometry circle =
        dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10));
    feature.setGeometry(circle);
    featureTransaction.setNewFeatures(new Feature[] {feature});
    request.setFeatureTransaction(featureTransaction);
    PersistTransactionResponse response = (PersistTransactionResponse) dispatcher.execute(
        PersistTransactionRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
View Full Code Here

    if (context instanceof MapModelWorkflowContext) {
      MapModelWorkflowContext mmc = (MapModelWorkflowContext) context;
      final MapModel mapModel = mmc.getMapModel();
      final FeatureTransaction ft = mmc.getFeatureTransaction();

      PersistTransactionRequest request = new PersistTransactionRequest();
      request.setFeatureTransaction(ft.toDto());
      request.setCrs(mapModel.getCrs());

      GwtCommand command = new GwtCommand(PersistTransactionRequest.COMMAND);
      command.setCommandRequest(request);

      GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
View Full Code Here

TOP

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

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.