Examples of PipelineContext


Examples of org.geomajas.service.pipeline.PipelineContext

      throws GeomajasException {
    log.debug("getBounds start on layer {}", layerId);
    long ts = System.currentTimeMillis();
    VectorLayer layer = getVectorLayer(layerId);
    GetBoundsContainer container = new GetBoundsContainer();
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.CRS_KEY, crs);
    context.put(PipelineCode.CRS_TRANSFORM_KEY, geoService.getCrsTransform(layer.getCrs(), crs));
    context.put(PipelineCode.FILTER_KEY, queryFilter);
    pipelineService.execute(PipelineCode.PIPELINE_GET_BOUNDS, layerId, context, container);
    log.debug("getBounds done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return container.getEnvelope();
  }
View Full Code Here

Examples of org.geomajas.service.pipeline.PipelineContext

  public InternalTile getTile(TileMetadata tileMetadata) throws GeomajasException {
    log.debug("getTile start tileMetadata {}", tileMetadata);
    long ts = System.currentTimeMillis();
    String layerId = tileMetadata.getLayerId();
    VectorLayer layer = getVectorLayer(layerId);
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.TILE_METADATA_KEY, tileMetadata);
    Crs crs = geoService.getCrs2(tileMetadata.getCrs());
    context.put(PipelineCode.CRS_KEY, crs);
    CrsTransform layerToMap = geoService.getCrsTransform(layer.getCrs(), crs);
    context.put(PipelineCode.CRS_TRANSFORM_KEY, layerToMap);
    Envelope layerExtent = dtoConverterService.toInternal(layer.getLayerInfo().getMaxExtent());
    Envelope tileExtent = geoService.transform(layerExtent, layerToMap);
    context.put(PipelineCode.TILE_MAX_EXTENT_KEY, tileExtent);
    InternalTile tile = new InternalTileImpl(tileMetadata.getCode(), tileExtent, tileMetadata.getScale());
    GetTileContainer response = new GetTileContainer();
    response.setTile(tile);
    pipelineService.execute(PipelineCode.PIPELINE_GET_VECTOR_TILE, layerId, context, response);
    log.debug("getTile response InternalTile {}", response);
View Full Code Here

Examples of org.geomajas.service.pipeline.PipelineContext

  public List<Attribute<?>> getAttributes(String layerId, String attributeName, Filter filter)
      throws GeomajasException {
    log.debug("saveOrUpdate start on layer {}", layerId);
    long ts = System.currentTimeMillis();
    VectorLayer layer = getVectorLayer(layerId);
    PipelineContext context = pipelineService.createContext();
    context.put(PipelineCode.LAYER_ID_KEY, layerId);
    context.put(PipelineCode.LAYER_KEY, layer);
    context.put(PipelineCode.FILTER_KEY, filter);
    context.put(PipelineCode.ATTRIBUTE_NAME_KEY, attributeName);
    GetAttributesContainer container = new GetAttributesContainer();
    pipelineService.execute(PipelineCode.PIPELINE_GET_ATTRIBUTES, layerId, context, container);
    log.debug("saveOrUpdate done on layer {}, time {}s", layerId, (System.currentTimeMillis() - ts) / 1000.0);
    return container.getAttributes();
  }
View Full Code Here

Examples of org.geomajas.service.pipeline.PipelineContext

  }

  /** @inheritDoc */
  public void execute(PipelineInfo<RESPONSE> pipeline, PipelineContext startContext, RESPONSE response)
      throws GeomajasException {
    PipelineContext context = startContext;
    if (null == context) {
      context = createContext();
    }
    long ps = 0;
    if (log.isDebugEnabled()) {
      ps = System.currentTimeMillis();
      log.debug("execute pipeline {}", pipeline.getPipelineName());
    }
    for (PipelineStep<RESPONSE> step : pipeline.getPipeline()) {
      if (context.isFinished()) {
        log.debug("context finished, pipeline {} execution done.", pipeline.getPipelineName());
        break;
      }
      long ts = 0;
      if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.geomajas.service.pipeline.PipelineContext

  }

  // ----------------------------------------------------------

  private PipelineContext getPipelineContext(int offset, int limit) {
    PipelineContext pip = new PipelineContextImpl();
    pip.put(PipelineCode.LAYER_KEY, testLayer);
    pip.put(PipelineCode.OFFSET_KEY, offset);
    pip.put(PipelineCode.MAX_RESULT_SIZE_KEY, limit);

    pip.put(PipelineCode.FILTER_KEY, Filter.INCLUDE);
    pip.put(PipelineCode.FEATURE_INCLUDES_KEY, 0);
    pip.put(PipelineCode.LAYER_ID_KEY, testLayer.getId());
    pip.put(PipelineCode.STYLE_KEY, new NamedStyleInfo());

    return pip;
  }
View Full Code Here

Examples of org.geomajas.service.pipeline.PipelineContext

  }

  // ----------------------------------------------------------

  private PipelineContext getPipelineContext(int offset, int limit) {
    PipelineContext pip = new PipelineContextImpl();
    pip.put(PipelineCode.LAYER_KEY, testLayer);
    pip.put(PipelineCode.OFFSET_KEY, offset);
    pip.put(PipelineCode.MAX_RESULT_SIZE_KEY, limit);

    pip.put(PipelineCode.FILTER_KEY, Filter.INCLUDE);
    pip.put(PipelineCode.FEATURE_INCLUDES_KEY, 0);
    pip.put(PipelineCode.LAYER_ID_KEY, testLayer.getId());
    pip.put(PipelineCode.STYLE_KEY, new NamedStyleInfo());

    return pip;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.