public String getMimeType(Object value, Operation operation) { GetCapabilitiesType request = (GetCapabilitiesType) OwsUtils.parameter(operation .getParameters(), GetCapabilitiesType.class); if ((request != null) && (request.getAcceptFormats() != null)) { //look for an accepted format List formats = request.getAcceptFormats().getOutputFormat(); for (Iterator f = formats.iterator(); f.hasNext();) { String format = (String) f.next(); if (format.endsWith("/xml")) { return format; } } } //default return "application/xml"; }
public WCSCapsTransformer getCapabilities(GetCapabilitiesType request) { // do the version negotiation dance List<String> provided = new ArrayList<String>(); // provided.add("1.0.0"); provided.add("1.1.0"); provided.add("1.1.1"); List<String> accepted = null; if (request.getAcceptVersions() != null) accepted = request.getAcceptVersions().getVersion(); String version = RequestUtils.getVersionOws11(provided, accepted); // TODO: add support for 1.0.0 in here if ("1.1.0".equals(version) || "1.1.1".equals(version)) { WCSCapsTransformer capsTransformer = new WCSCapsTransformer(wcs, catalog); capsTransformer.setEncoding(wcs.getCharSet()); return capsTransformer; } throw new WcsException("Could not understand version:" + version); }
assertEquals("WCS", cap.getService()); assertEquals(1, cap.getAcceptVersions().getVersion().size()); assertEquals("1.0.0", cap.getAcceptVersions().getVersion().get(0)); assertEquals(1, cap.getSections().getSection().size()); assertEquals("Section1", cap.getSections().getSection().get(0)); assertEquals(1, cap.getAcceptFormats().getOutputFormat().size()); assertEquals("text/xml", cap.getAcceptFormats().getOutputFormat().get(0));
if (request.getUpdateSequence() != null) { try { requestedUpdateSequence = Integer.parseInt(request.getUpdateSequence()); } catch (NumberFormatException e) { throw new WcsException("Invalid update sequence number format, " .toString(); proxifiedBaseUrl = RequestUtils.proxifiedBaseURL(request.getBaseUrl(), wcs .getGeoServer().getProxyBaseUrl()); final String locationDef = WCS_URI + " " + proxifiedBaseUrl if (request.getSections() == null) { allSections = true; sections = Collections.emptyList(); } else { sections = request.getSections().getSection(); allSections = sections.contains("All");
protected void handleMetadataLink(MetadataLinkInfo mdl, String linkType) { AttributesImpl attributes = new AttributesImpl(); if ((mdl.getAbout() != null) && (mdl.getAbout() != "")) { attributes.addAttribute("", "about", "about", "", mdl.getAbout()); } if ((linkType != null) && (linkType != "")) { attributes.addAttribute("", "xlink:type", "xlink:type", "", linkType); } if ((mdl.getContent() != null) && (mdl.getContent() != "")) { attributes.addAttribute( "", "xlink:href", "xlink:href", "", ResponseUtils.proxifyMetadataLink(mdl, request.getBaseUrl())); element("ows:Metadata", null, attributes); } }
if (request.getNamespace() != null) { String namespace = request.getNamespace(); for (Iterator it = coverages.iterator(); it.hasNext(); ) { CoverageInfo cv = (CoverageInfo) it.next();
@Test public void testBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" " + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs/1.1.1\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; // smoke test, we only try out a very basic request GetCapabilitiesType cap = (GetCapabilitiesType) reader.read(null, new StringReader(request), null); assertEquals("WCS", cap.getService()); }
if (request.getUpdateSequence() != null) { try { requestedUpdateSequence = Long.parseLong(request.getUpdateSequence()); } catch (NumberFormatException e) { throw new WcsException( + " " + buildSchemaURL( request.getBaseUrl(), "wcs/1.1.1/wcsGetCapabilities.xsd"); if (request.getSections() == null) { allSections = true; sections = Collections.emptyList(); } else { sections = request.getSections().getSection(); allSections = sections.contains("All");
buildURL(request.getBaseUrl(), "wcs", null, URLType.SERVICE), "");
public String getMimeType(Object value, Operation operation) { GetCapabilitiesType request = OwsUtils.parameter(operation.getParameters(), GetCapabilitiesType.class); if ((request != null) && (request.getAcceptFormats() != null)) { // look for an accepted format List formats = request.getAcceptFormats().getOutputFormat(); for (Iterator f = formats.iterator(); f.hasNext(); ) { String format = (String) f.next(); if (format.endsWith("/xml")) { return format; } } } // default return "text/xml"; }
public WCSCapsTransformer getCapabilities(GetCapabilitiesType request) { // do the version negotiation dance List<String> provided = new ArrayList<String>(); // provided.add("1.0.0"); provided.add("1.1.0"); provided.add("1.1.1"); List<String> accepted = null; if (request.getAcceptVersions() != null) accepted = request.getAcceptVersions().getVersion(); String version = RequestUtils.getVersionOws11(provided, accepted); // TODO: add support for 1.0.0 in here if ("1.1.0".equals(version) || "1.1.1".equals(version)) { WCSCapsTransformer capsTransformer = new WCSCapsTransformer(geoServer); capsTransformer.setEncoding( Charset.forName((getServiceInfo().getGeoServer().getSettings().getCharset()))); return capsTransformer; } throw new WcsException("Could not understand version:" + version); }
@Override public String getMimeType(Object value, Operation operation) { GetCapabilitiesType request = (GetCapabilitiesType) OwsUtils.parameter(operation.getParameters(), GetCapabilitiesType.class); if ((request != null) && (request.getAcceptFormats() != null)) { // look for an accepted format List<String> formats = request.getAcceptFormats().getOutputFormat(); for (String format : formats) { if (format.endsWith("/xml")) { return format; } } } // default return "application/xml"; }