public int compare(Object o1, Object o2) { Service s1 = (Service) o1; Service s2 = (Service) o2; return s1.getVersion().compareTo(s2.getVersion()); } };
Service s = (Service) itr.next(); if (version.equals(s.getVersion())) { continue;
String version = null; if (useServiceVersion && request.getServiceDescriptor() != null) { version = request.getServiceDescriptor().getVersion().toString();
Service service = (Service) s.next(); if (version.equals(service.getVersion())) { found = true;
@Override public String getAttachmentFileName(Object value, Operation operation) { return "getcapabilities_" + operation.getService().getVersion().toString() + ".xml"; }
/** * Makes sure this triggers only * </p> */ public boolean canHandle(Operation operation) { // is this a wcs 1.1.1 or 1.1.0 one? return "GetCapabilities".equalsIgnoreCase(operation.getId()) && operation.getService().getId().equals("wcs") && (operation.getService().getVersion().toString().equals("1.1.0") || operation.getService().getVersion().toString().equals("1.1.1")); }
@Override public void onApplicationEvent(ContextRefreshedEvent event) { // configure the extra operation in WFS 2.0 List<Service> services = GeoServerExtensions.extensions(Service.class); for (Service s : services) { if ("wfs".equals(s.getId().toLowerCase()) && Integer.valueOf(2).equals(s.getVersion().getMajor())) { if (!s.getOperations().contains(PAGE_RESULTS)) { s.getOperations().add(PAGE_RESULTS); } } } } }
/** Makes sure this triggers only */ public boolean canHandle(Operation operation) { // is this a wcs 1.1.1 or 1.1.0 one? return "GetCapabilities".equalsIgnoreCase(operation.getId()) && operation.getService().getId().equals("wcs") && (operation.getService().getVersion().toString().equals("1.1.0") || operation.getService().getVersion().toString().equals("1.1.1")); }
/** Makes sure this triggers only */ @Override public boolean canHandle(Operation operation) { return "GetCapabilities".equalsIgnoreCase(operation.getId()) && operation.getService().getId().equals(WCS20Const.SERVICE_NAME) && (operation.getService().getVersion().toString().equals(WCS20Const.V201) || operation.getService().getVersion().toString().equals(WCS20Const.V20)); }
@Override public Service serviceDispatched(Request request, Service service) throws ServiceException { Object req = request.getKvp().get("REQUEST"); if ("wfs".equals(service.getId().toLowerCase()) && PAGE_RESULTS.equals(req)) { // allow the request to be successfully parsed as a GetFeature (needs at least a // typename or a featureId) request.getKvp().put("featureId", Collections.singletonList("dummy")); // replace the service return new Service( service.getId(), this.service, service.getVersion(), service.getOperations()); } return service; }
/** Makes sure this triggers only */ public boolean canHandle(Operation operation) { return "GetCapabilities".equalsIgnoreCase(operation.getId()) && operation.getService().getId().equals("wcs") && operation.getService().getVersion().toString().equals("1.0.0"); }
/** @see org.geoserver.web.CapabilitiesHomePageLinkProvider#getCapabilitiesComponent */ public Component getCapabilitiesComponent(final String id) { List<CapsInfo> serviceInfoLinks = new ArrayList<CapabilitiesHomePagePanel.CapsInfo>(); List<Service> extensions = GeoServerExtensions.extensions(Service.class); for (Service si : extensions) { if (si.getCustomCapabilitiesLink() != null) { String serviceId = si.getId(); String capsLink = si.getCustomCapabilitiesLink(); CapsInfo ci = new CapsInfo(serviceId, si.getVersion(), capsLink); serviceInfoLinks.add(ci); } else if (si.getOperations().contains("GetCapabilities")) { String serviceId = si.getId(); String capsLink = "../ows?service=" + serviceId + "&version=" + si.getVersion().toString() + "&request=GetCapabilities"; CapsInfo ci = new CapsInfo(serviceId, si.getVersion(), capsLink); serviceInfoLinks.add(ci); } } return new CapabilitiesHomePagePanel(id, serviceInfoLinks); } }
if (new Version("1.1.0").equals(operation.getService().getVersion())) { write1_1(lockResponse, output, operation);
public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { TransactionResponseType response = (TransactionResponseType) value; if (new Version("1.0.0").equals(operation.getService().getVersion())) { v_1_0(response, output, operation); } else { v_1_1(response, output, operation); } }
@Override public Response responseDispatched( Request request, Operation operation, Object result, Response response) { Service service = operation.getService(); if (service == null || service.getId() == null || !service.getId().equalsIgnoreCase("wfs")) { // not a WFS service so we are not interested in it return response; } String responseMimeType = response.getMimeType(result, operation); if (!isGmlBased(responseMimeType)) { // no a GML based response return response; } WFSInfo wfs = geoserver.getService(WFSInfo.class); GMLInfo gmlInfo = wfs.getGML().get(WFSInfo.Version.negotiate(service.getVersion().toString())); if (gmlInfo == null || !gmlInfo.getMimeTypeToForce().isPresent()) { // we don't need to force any specific MIME type return response; } // enforce the configured MIME type String mimeType = gmlInfo.getMimeTypeToForce().get(); LOGGER.info( String.format( "Overriding MIME type '%s' with '%s' for WFS operation '%s'.", responseMimeType, mimeType, operation.getId())); return new ResponseWrapper(response, mimeType); }
String toJSON(Operation op, Map<String, Object> opts) { int depth = Converters.convert(opts.getOrDefault(OPT_DEPTH, 3), Integer.class); JSONStringer out = new JSONStringer(); out.object(); Service srv = op.getService(); out.key("service") .object() .key("name") .value(srv.getId()) .key("version") .value(srv.getVersion()) .endObject(); out.key("operation").object().key("name").value(op.getId()); Object req = Arrays.stream(op.getParameters()).findFirst().orElse(null); if (req != null) { out.key("request"); traverse(req, 0, depth, out); } out.endObject(); // operation out.endObject(); return out.toString(); }
version = request.getServiceDescriptor().getVersion().toString();