org.geoserver.ows.Request.getRawKvp()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中org.geoserver.ows.Request.getRawKvp方法的一些代码示例,展示了Request.getRawKvp的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRawKvp方法的具体详情如下:
包路径:org.geoserver.ows.Request
类名称:Request
方法名:getRawKvp

Request.getRawKvp介绍

[英]The raw, un-parsed key value pair map
[中]原始的、未解析的键值对映射

代码示例

代码示例来源:origin: geoserver/geoserver

void setHeaders(Request req, Operation opDescriptor, Object result, Response response) {
  Map rawKvp = req.getRawKvp();
  String disposition = response.getPreferredDisposition(result, opDescriptor);
  String filename = response.getAttachmentFileName(result, opDescriptor);

代码示例来源:origin: geoserver/geoserver

Object parseRequestKVP(Class type, Request request) throws Exception {
  KvpRequestReader kvpReader = findKvpRequestReader(type);
  if (kvpReader != null) {
    // check for http request awareness
    if (kvpReader instanceof HttpServletRequestAware) {
      ((HttpServletRequestAware) kvpReader).setHttpRequest(request.getHttpRequest());
    }
    Object requestBean = kvpReader.createRequest();
    if (requestBean != null) {
      requestBean = kvpReader.read(requestBean, request.getKvp(), request.getRawKvp());
    }
    return requestBean;
  }
  return null;
}

代码示例来源:origin: org.geoserver.extension/gs-geofence

private List<String> parseStylesParameter(Request gsRequest) {
  String rawStylesParameter = (String) gsRequest.getRawKvp().get("STYLES");
  if (rawStylesParameter != null) {
    return KvpUtils.readFlat(rawStylesParameter);
  }
  return new ArrayList<>();
}

代码示例来源:origin: org.geoserver.community/gs-geofence

private List<String> parseStylesParameter(Request gsRequest) {
  String rawStylesParameter = (String) gsRequest.getRawKvp().get("STYLES");
  if (rawStylesParameter != null) {
    return KvpUtils.readFlat(rawStylesParameter);
  }
  return new ArrayList<>();
}

代码示例来源:origin: org.geoserver/gs-wms

@Override
protected void qualifyRequest(
    WorkspaceInfo ws, PublishedInfo l, Service service, Request request) {
  if (WebMapService.class.isInstance(service.getService())) {
    String layers = (String) request.getRawKvp().get("LAYERS");
    if (layers != null) {
      request.getRawKvp().put("LAYERS", qualifyLayerNamesKVP(layers, ws));
    }
    layers = (String) request.getRawKvp().get("QUERY_LAYERS");
    if (layers != null) {
      request.getRawKvp().put("QUERY_LAYERS", qualifyLayerNamesKVP(layers, ws));
    }
    String layer = (String) request.getRawKvp().get("LAYER");
    if (layer != null) {
      request.getRawKvp().put("LAYER", qualifyName(layer, ws));
    }
    String styles = (String) request.getRawKvp().get("STYLES");
    if (styles != null && !styles.trim().isEmpty()) {
      request.getRawKvp().put("STYLES", qualifyStyleNamesKVP(styles, ws));
    }
    String style = (String) request.getRawKvp().get("STYLE");
    if (style != null && !style.trim().isEmpty()) {
      request.getRawKvp().put("STYLE", qualifyStyleName(style, ws));
    }
  }
}

代码示例来源:origin: org.geoserver/gs-wms

String filename = null;
if (request != null
    && request.getRawKvp() != null
    && request.getRawKvp().get("LAYERS") != null) {
  String layers = ((String) request.getRawKvp().get("LAYERS")).trim();
  if (layers.length() > 0) {
    filename = layers.replace(",", "_");

代码示例来源:origin: org.geoserver.community/gs-oseo-core

@Override
public Service serviceDispatched(Request request, Service service) throws ServiceException {
  final Map kvp = request.getKvp();
  final Map rawKvp = request.getRawKvp();
  if ("oseo".equalsIgnoreCase(request.getService())) {
    if (kvp.isEmpty()) {
      for (String key : new HashSet<String>(request.getRawKvp().keySet())) {
        Object value = rawKvp.get(key);
        if ((!(value instanceof String) || StringUtils.isEmpty((String) value))

代码示例来源:origin: org.geoserver/gs-wms

@Override
  public TemplateModel get(String key) throws TemplateModelException {
    String value = (String) env.get(key);
    // also allow using the other request parameters
    if (value == null) {
      Request request = Dispatcher.REQUEST.get();
      if (request != null && request.getRawKvp() != null) {
        Object obj = request.getRawKvp().get(key);
        value = Converters.convert(obj, String.class);
        if (obj != null && value == null) {
          // try also Spring converters as a fallback, can do some thing
          // GT converters
          // cannot do (e.g array -> string). Did not create a bridge to
          // GT converters as it might
          // have global consequences
          DefaultConversionService.getSharedInstance()
              .convert(obj, String.class);
        }
      }
    }
    if (value != null) {
      return new StringModel(value, bw);
    } else {
      return null;
    }
  }
});

代码示例来源:origin: org.geoserver.community/gs-ows-simulate

@Override
public Operation operationDispatched(Request request, Operation operation) {
  String sim =
      Optional.ofNullable(request.getRawKvp().get(KVP))
          .map(String.class::cast)
          .orElse(null);
  if (sim == null) {
    return operation;
  }
  Map<String, Object> simOpts;
  if (sim.contains(";")) {
    try {
      simOpts = (Map<String, Object>) new FormatOptionsKvpParser().parse(sim.toString());
    } catch (Exception e) {
      throw new RuntimeException(
          "Illegal syntax for simulate options: simulate=<key>:<val>[;<key>:<val>]*",
          e);
    }
  } else {
    simOpts = Collections.emptyMap();
  }
  throw new HttpErrorCodeException(202, toJSON(operation, simOpts))
      .setContentType("application/json");
}

代码示例来源:origin: org.geoserver.community/gs-geofence

private List<Object> parseLayersParameter(Request gsRequest, GetMapRequest getMap) {
  String rawLayersParameter = (String) gsRequest.getRawKvp().get("LAYERS");
  if (rawLayersParameter != null) {
    List<String> layersNames = KvpUtils.readFlat(rawLayersParameter);
    return new LayersParser()
        .parseLayers(layersNames, getMap.getRemoteOwsURL(), getMap.getRemoteOwsType());
  }
  return new ArrayList<>();
}

代码示例来源:origin: org.geoserver.extension/gs-geofence

private List<Object> parseLayersParameter(Request gsRequest, GetMapRequest getMap) {
  String rawLayersParameter = (String) gsRequest.getRawKvp().get("LAYERS");
  if (rawLayersParameter != null) {
    List<String> layersNames = KvpUtils.readFlat(rawLayersParameter);
    return new LayersParser()
        .parseLayers(layersNames, getMap.getRemoteOwsURL(), getMap.getRemoteOwsType());
  }
  return new ArrayList<>();
}

代码示例来源:origin: org.geoserver.community/gs-params-extractor

@Override
public void mangleURL(
    StringBuilder baseURL, StringBuilder path, Map<String, String> kvp, URLType type) {
  Request request = Dispatcher.REQUEST.get();
  if (request == null || !"GetCapabilities".equalsIgnoreCase(request.getRequest())) {
    return;
  }
  forwardOriginalUri(request, path);
  Map requestRawKvp = request.getRawKvp();
  if (request.getHttpRequest() instanceof RequestWrapper) {
    RequestWrapper requestWrapper = (RequestWrapper) request.getHttpRequest();
    Map parameters = requestWrapper.getOriginalParameters();
    requestRawKvp = new KvpMap(KvpUtils.normalize(parameters));
  }
  forwardParameters(requestRawKvp, kvp);
}

代码示例来源:origin: org.geoserver.community/gs-nsg-wfs-profile

Map rawKvp = request.getRawKvp();
RequestData data = new RequestData();
data.setKvp(kvp);

代码示例来源:origin: org.geoserver/gs-wms

if (dispatcherRequest != null) {
  request.setKvp(dispatcherRequest.getKvp());
  request.setRawKvp(dispatcherRequest.getRawKvp());

代码示例来源:origin: org.geoserver/gs-wfs

kvp = new KvpMap(req.getRawKvp());
} else {

代码示例来源:origin: org.geoserver/gs-wms

mapLayer.setTitle(wmtsLayer.prefixedName());
mapLayer.setRawTime((String) Dispatcher.REQUEST.get().getRawKvp().get("time"));

相关文章