public void testBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" updateSequence=\"1\" " + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\" " + "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()); assertEquals("1.0.0", cap.getVersion()); assertEquals("1", cap.getUpdateSequence()); }
if (request.getUpdateSequence() != null) { try { requestedUpdateSequence = Long.parseLong(request.getUpdateSequence()); } catch (NumberFormatException e) { if (request.getUpdateSequence().length() == 0) requestedUpdateSequence = 0; else throw new WcsException( + " " + buildURL( request.getBaseUrl(), appendPath(SCHEMAS, "wcs/1.0.0/wcsCapabilities.xsd"), null, if (request.getSection() == null) { allSections = true; section = CapabilitiesSectionType.get("/"); } else { section = request.getSection(); allSections = (section.get("/").equals(section));
getCapabilities.setVersion(ver);
/** */ public Wcs10CapsTransformer getCapabilities(GetCapabilitiesType request) { // do the version negotiation dance List<String> provided = new ArrayList<String>(); provided.add("1.0.0"); List<String> accepted = null; if (request.getVersion() != null) { accepted = new ArrayList<String>(); accepted.add(request.getVersion()); } String version = RequestUtils.getVersionPreOws(provided, accepted); if ("1.0.0".equals(version)) { Wcs10CapsTransformer capsTransformer = new Wcs10CapsTransformer(geoServer); capsTransformer.setEncoding( Charset.forName((getServiceInfo().getGeoServer().getSettings().getCharset()))); return capsTransformer; } throw new WcsException("Could not understand version:" + version); }
private 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.getMetadataType() != null) && (mdl.getMetadataType() != "")) { attributes.addAttribute( "", "metadataType", "metadataType", "", mdl.getMetadataType()); } if ((mdl.getContent() != null) && (mdl.getContent() != "")) { attributes.addAttribute( "", "xlink:href", "xlink:href", "", ResponseUtils.proxifyMetadataLink(mdl, request.getBaseUrl())); } if (attributes.getLength() > 0) { element("wcs:metadataLink", null, attributes); } }
private void handleCapability(String capabilityName) { AttributesImpl attributes = new AttributesImpl(); start(capabilityName); start("wcs:DCPType"); start("wcs:HTTP"); // String baseURL = RequestUtils.proxifiedBaseURL(request.getBaseUrl(), // wcs.getGeoServer().getGlobal().getProxyBaseUrl()); String url = buildURL(request.getBaseUrl(), "wcs", null, URLType.SERVICE); url = makeURLAppendable(url); attributes.addAttribute("", "xlink:href", "xlink:href", "", url); start("wcs:Get"); start("wcs:OnlineResource", attributes); end("wcs:OnlineResource"); end("wcs:Get"); end("wcs:HTTP"); end("wcs:DCPType"); attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", url); start("wcs:DCPType"); start("wcs:HTTP"); start("wcs:Post"); start("wcs:OnlineResource", attributes); end("wcs:OnlineResource"); end("wcs:Post"); end("wcs:HTTP"); end("wcs:DCPType"); end(capabilityName); }
@Test public void testBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" updateSequence=\"1\" " + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\" " + "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()); assertEquals("1.0.0", cap.getVersion()); assertEquals("1", cap.getUpdateSequence()); } }