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

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

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

Request.setKvp介绍

[英]Allows callbacks to change the parsed KVP map

Clients should consider calling #setOrAppendKvp(java.util.Map) to retain the existing kvp map.
[中]允许回调更改已解析的KVP映射
客户应该考虑调用java SETROR AppEntKVP(java. U.L.map)来保留现有的KVP映射。

代码示例

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

/**
 * Sets the parsed kvp map, appending/overwriting to any previously set values.
 *
 * @param kvp Parsed kvp values.
 */
public void setOrAppendKvp(Map kvp) {
  if (this.kvp == null) {
    setKvp(kvp);
  } else {
    this.kvp.putAll(kvp);
  }
}

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

void preParseKVP(Request req) throws ServiceException {
  HttpServletRequest request = req.getHttpRequest();
  // unparsed kvp set
  Map kvp = request.getParameterMap();
  if (kvp == null || kvp.isEmpty()) {
    req.setKvp(new HashMap());
    // req.kvp = null;
    return;
  }
  // track parsed kvp and unparsd
  Map parsedKvp = KvpUtils.normalize(kvp);
  Map rawKvp = new KvpMap(parsedKvp);
  req.setKvp(parsedKvp);
  req.setRawKvp(rawKvp);
}

代码示例来源:origin: org.geoserver/gwc

@Override
public Request init(Request request) {
  String context = request.getContext();
  if (context == null || !context.startsWith("gwc/service")) {
    return null;
  }
  Map<String, String> kvp = new HashMap<String, String>();
  kvp.put("service", "gwc");
  kvp.put("version", "1.0.0");
  kvp.put("request", "dispatch");
  request.setKvp(kvp);
  request.setRawKvp(kvp);
  return request;
}

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

/**
 * Simulates what the Dispatcher is doing when parsing a KVP request
 *
 * @param href
 * @param reader
 */
protected Object kvpParse(String href, KvpRequestReader reader) throws Exception {
  Map original = new KvpMap(KvpUtils.parseQueryString(href));
  KvpUtils.normalize(original);
  Map parsed = new KvpMap(original);
  List<Throwable> errors = KvpUtils.parse(parsed);
  if (errors.size() > 0) {
    throw new WPSException("Failed to parse KVP request", errors.get(0));
  }
  // hack to allow wcs filters to work... we should really upgrade the WCS models instead...
  Request r = Dispatcher.REQUEST.get();
  if (r != null) {
    Map kvp = new HashMap(r.getKvp());
    r.setKvp(new CaseInsensitiveMap(parsed));
  }
  return reader.read(reader.createRequest(), parsed, original);
}

代码示例来源:origin: org.geoserver.extension/wps-core

/**
 * Simulates what the Dispatcher is doing when parsing a KVP request
 * 
 * @param href
 * @param reader
 * @return
 */
Object kvpParse(String href, KvpRequestReader reader) throws Exception {
  Map original = new KvpMap(KvpUtils.parseQueryString(href));
  KvpUtils.normalize(original);
  Map parsed = new KvpMap(original);
  List<Throwable> errors = KvpUtils.parse(parsed);
  if (errors.size() > 0) {
    throw new WPSException("Failed to parse KVP request", errors.get(0));
  }
  // hack to allow wcs filters to work... we should really upgrade the WCS models instead...
  Request r = Dispatcher.REQUEST.get();
  if (r != null) {
    Map kvp = new HashMap(r.getKvp());
    r.setKvp(new CaseInsensitiveMap(parsed));
  }
  return reader.read(reader.createRequest(), parsed, original);
}

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

request.setKvp(kvp);
request.setRawKvp(kvp);

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

kvp.put("STYLES", ",lines");
Request gsRequest = new Request();
gsRequest.setKvp(kvp);
gsRequest.setRawKvp(kvp);
String service = "WMS";

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

kvp.put("STYLES", ",lines");
Request gsRequest = new Request();
gsRequest.setKvp(kvp);
gsRequest.setRawKvp(kvp);
String service = "WMS";

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

@Before
public void setUp() throws URISyntaxException, IOException {
  outputFormat = new TextFeatureInfoOutputFormat(getWMS());
  Request request = new Request();
  parameters = new HashMap<String, Object>();
  parameters.put("LAYER", "testLayer");
  Map<String, String> env = new HashMap<String, String>();
  env.put("TEST1", "VALUE1");
  env.put("TEST2", "VALUE2");
  parameters.put("ENV", env);
  request.setKvp(parameters);
  Dispatcher.REQUEST.set(request);
  final FeatureTypeInfo featureType = getFeatureTypeInfo(MockData.NULLS);
  fcType = WfsFactory.eINSTANCE.createFeatureCollectionType();
  fcType.getFeature().add(featureType.getFeatureSource(null, null).getFeatures());
  // fake layer list
  List<MapLayerInfo> queryLayers = new ArrayList<MapLayerInfo>();
  LayerInfo layerInfo = new LayerInfoImpl();
  layerInfo.setType(PublishedType.VECTOR);
  ResourceInfo resourceInfo = new FeatureTypeInfoImpl(null);
  NamespaceInfo nameSpace = new NamespaceInfoImpl();
  nameSpace.setPrefix("topp");
  nameSpace.setURI("http://www.topp.org");
  resourceInfo.setNamespace(nameSpace);
  layerInfo.setResource(resourceInfo);
  MapLayerInfo mapLayerInfo = new MapLayerInfo(layerInfo);
  queryLayers.add(mapLayerInfo);
  getFeatureInfoRequest = new GetFeatureInfoRequest();
  getFeatureInfoRequest.setQueryLayers(queryLayers);
}

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

"getLegendGraphic", wmsService, null, new Object[] {getLegendGraphics});
Request request = new Request();
request.setKvp(params);
request.setRawKvp(params);
Dispatcher.REQUEST.set(request);

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

env.put("TEST2", "VALUE2");
parameters.put("ENV", env);
request.setKvp(parameters);

相关文章