attributes.addAttribute( "", "updateSequence", "updateSequence", "", String.valueOf(updateSequence)); helper.registerNamespaces(getNamespaceSupport(), attributes); buildSchemaLocation( request.getBaseUrl(), WCS.NAMESPACE, start("wcs:Capabilities", attributes); handleServiceIdentification(); if (allSections || sections.contains(SECTIONS.ServiceProvider.name())) handleServiceProvider(); if (allSections || sections.contains(SECTIONS.OperationsMetadata.name())) handleOperationsMetadata(); if (allSections || sections.contains(SECTIONS.ServiceMetadata.name())) handleServiceMetadata(request); if (allSections || sections.contains(SECTIONS.Contents.name())) handleContents(); if (allSections || sections.contains(SECTIONS.Languages.name())) handleLanguages(); end("wcs:Capabilities");
private void handleContents() { start("wcs:Contents"); mark(); handleCoverageSummary(cv); commit(); } catch (Exception e) { if (skipMisconfigured) { reset(); LOGGER.log( Level.SEVERE, start("wcs:Extension"); try { for (WCSExtendedCapabilitiesProvider provider : extensions) { throw new ServiceException("Extended capabilities provider threw error", e); end("wcs:Extension"); end("wcs:Contents");
private void handleOperation(String capabilityName, Map<String, List<String>> parameters) { AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute(null, "name", "name", null, capabilityName); start("ows:Operation", attributes); start("ows:DCP"); start("ows:HTTP"); attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", url); element("ows:Get", null, attributes); end("ows:HTTP"); end("ows:DCP"); start("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); end("ows:DCP"); attributes = new AttributesImpl(); attributes.addAttribute("", "name", "name", "", param.getKey()); start("ows:Parameter", attributes); start("ows:AllowedValues"); for (String value : param.getValue()) { element("ows:Value", value); end("ows:AllowedValues"); end("ows:Parameter"); end("ows:Operation");
start("ows:ServiceIdentification"); element("ows:Title", wcs.getTitle()); element("ows:Abstract", wcs.getAbstract()); handleKeywords(wcs.getKeywords()); element( "ows:ServiceType", "urn:ogc:service:wcs"); // TODO: check this: some docs specify a "OGC WCS" element("ows:ServiceTypeVersion", WCS20Const.V201); element("ows:ServiceTypeVersion", WCS20Const.V111); element("ows:ServiceTypeVersion", WCS20Const.V110); element("ows:Profile", "http://www.opengis.net/spec/WCS/2.0/conf/core"); element( "ows:Profile", "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0.1"); // requirement #1 in OGC 09-147r3 element("ows:Profile", "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0"); element( "ows:Profile", "http://www.opengis.net/spec/WCS_service-extension_crs/1.0/conf/crs-gridded-coverage"); element( "ows:Profile", " http://www.opengis.net/spec/WCS_geotiff-coverages/1.0/conf/geotiff-coverage"); // TODO: check specs and URL
private void handleServiceMetadata(GetCapabilitiesType ct) { start("wcs:ServiceMetadata"); element("wcs:formatSupported", format); start("wcs:Extension"); element("wcscrs:crsSupported", "http://www.opengis.net/def/crs/EPSG/0/" + code); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/nearest-neighbor"); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/linear"); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/cubic"); end("wcs:Extension"); end("wcs:ServiceMetadata");
boundingBox.getCoordinateReferenceSystem(), false)); start("ows:BoundingBox", attributes); element( "ows:LowerCorner", new StringBuilder(Double.toString(boundingBox.getLowerCorner().getOrdinate(0))) .toString()); element( "ows:UpperCorner", new StringBuilder(Double.toString(boundingBox.getUpperCorner().getOrdinate(0))) .append(boundingBox.getUpperCorner().getOrdinate(1)) .toString()); end("ows:BoundingBox");
this.extensions = GeoServerExtensions.extensions(WCSExtendedCapabilitiesProvider.class); NamespaceSupport namespaces = getNamespaceSupport(); namespaces.declarePrefix( "wcscrs", "http://www.opengis.net/wcs/service-extension/crs/1.0");
start("ows:OperationsMetadata"); handleOperation("GetCapabilities", null); handleOperation("DescribeCoverage", null); handleOperation("GetCoverage", null); start("ows:Constraint", attributes); start("ows:AllowedValues"); element("ows:Value", "XML"); end("ows:AllowedValues"); end("ows:Constraint"); end("ows:OperationsMetadata");
start("ows:ServiceContact"); elementIfNotEmpty("ows:IndividualName", contact.getContactPerson()); elementIfNotEmpty("ows:PositionName", contact.getContactPosition()); start("ows:ContactInfo"); start("ows:Phone"); elementIfNotEmpty("ows:Voice", contact.getContactVoice()); elementIfNotEmpty("ows:Facsimile", contact.getContactFacsimile()); end("ows:Phone"); start("ows:Address"); elementIfNotEmpty("ows:DeliveryPoint", contact.getAddress()); elementIfNotEmpty("ows:City", contact.getAddressCity()); elementIfNotEmpty("ows:AdministrativeArea", contact.getAddressState()); elementIfNotEmpty("ows:PostalCode", contact.getAddressPostalCode()); elementIfNotEmpty("ows:Country", contact.getAddressCountry()); elementIfNotEmpty("ows:ElectronicMailAddress", contact.getContactEmail()); end("ows:Address"); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", or); start("ows:OnlineResource", attributes); end("OnlineResource"); end("ows:ContactInfo"); end("ows:ServiceContact");
/** * Handles the service provider of the capabilities document. * * @param config The OGC service to transform. * @throws SAXException For any errors. */ private void handleServiceProvider() { start("ows:ServiceProvider"); SettingsInfo settings = wcs.getGeoServer().getSettings(); element("ows:ProviderName", settings.getContact().getContactOrganization()); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute( "", "xlink:href", "xlink:href", "", settings.getOnlineResource() != null ? settings.getOnlineResource() : ""); element("ows:ProviderSite", null, attributes); handleContact(); end("ows:ServiceProvider"); }
private void handleWGS84BoundingBox(BoundingBox envelope) { start("ows:WGS84BoundingBox"); element( "ows:LowerCorner", new StringBuilder(Double.toString(envelope.getLowerCorner().getOrdinate(0))) .append(" ") .append(envelope.getLowerCorner().getOrdinate(1)) .toString()); element( "ows:UpperCorner", new StringBuilder(Double.toString(envelope.getUpperCorner().getOrdinate(0))) .append(" ") .append(envelope.getUpperCorner().getOrdinate(1)) .toString()); end("ows:WGS84BoundingBox"); }
@Override public Translator createTranslator(ContentHandler handler) { return new WCS20GetCapabilitiesTranslator(handler); }
/** * DOCUMENT ME! * * @param kwords DOCUMENT ME! * @throws SAXException DOCUMENT ME! */ private void handleKeywords(List<KeywordInfo> kwords) { if (kwords != null && !kwords.isEmpty()) { start("ows:Keywords"); for (KeywordInfo kword : kwords) { element("ows:Keyword", kword.getValue()); } end("ows:Keywords"); } }
/** * Writes the element if and only if the content is not null and not empty * * @param elementName * @param content */ private void elementIfNotEmpty(String elementName, String content) { if (isNotBlank(content)) element(elementName, content); } }
private void handleCoverageSummary(CoverageInfo cv) throws Exception { start("wcs:CoverageSummary"); String covId = NCNameResourceCodec.encode(cv); element("wcs:CoverageId", covId); element("wcs:CoverageSubtype", "RectifiedGridCoverage"); // TODO make this parametric handleWGS84BoundingBox(cv.getLatLonBoundingBox()); handleBoundingBox(cv.boundingBox()); end("wcs:CoverageSummary"); }