/** * DOCUMENT ME! * * @param kwords DOCUMENT ME! * @throws SAXException DOCUMENT ME! */ protected void handleKeywords(List kwords) { if (kwords != null && kwords.size() > 0) { start("ows:Keywords"); if (kwords != null) { for (Iterator it = kwords.iterator(); it.hasNext(); ) { element("ows:Keyword", it.next().toString()); } } end("ows:Keywords"); } }
/** * DOCUMENT ME! * * @param kwords * DOCUMENT ME! * * @throws SAXException * DOCUMENT ME! */ private void handleKeywords(List kwords) { start("ows:Keywords"); if (kwords != null) { for (Iterator it = kwords.iterator(); it.hasNext();) { element("ows:Keyword", it.next().toString()); } } end("ows:Keywords"); }
private void handleContents() { start("wcs:Contents"); List coverages = new ArrayList(wcs.getData().getCoverageInfos().values()); Collections.sort(coverages, new CoverageInfoLabelComparator()); for (Iterator i = coverages.iterator(); i.hasNext();) { CoverageInfo cv = (CoverageInfo) i.next(); if (cv.isEnabled()) handleCoverageSummary(cv); } end("wcs:Contents"); }
end("wcs:Capabilities");
end("wcs:Capabilities");
end("wcs:Contents");
attributes.addAttribute("", "xlink:href", "xlink:href", "", url); element("ows:Get", null, attributes); end("ows:HTTP"); end("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); end("ows:DCP"); element("ows:Value", value); end("ows:AllowedValues"); end("ows:Parameter"); end("ows:Operation");
elementIfNotEmpty("ows:Voice", gs.getContactVoice()); elementIfNotEmpty("ows:Facsimile", gs.getContactFacsimile()); end("ows:Phone"); start("ows:Address"); elementIfNotEmpty("ows:DeliveryPoint", gs.getAddress()); elementIfNotEmpty("ows:Country", gs.getAddressCountry()); elementIfNotEmpty("ows:ElectronicMailAddress", gs.getContactEmail()); end("ows:Address"); attributes.addAttribute("", "xlink:href", "xlink:href", "", or); start("ows:OnlineResource", attributes); end("OnlineResource"); end("ows:ContactInfo"); end("ows:ServiceContact");
/** * Handles the OperationMetadata portion of the document, printing out the operations and * where to bind to them. * * @param config The global wms. * @throws SAXException For any problems. */ protected void handleOperationsMetadata() { start("ows:OperationsMetadata"); handleOperation("GetCapabilities", null); handleOperation("DescribeCoverage", null); handleOperation( "GetCoverage", new HashMap<String, List<String>>() { { put("store", Arrays.asList("True", "False")); } }); // specify that we do support xml post encoding, clause 8.3.2.2 of // the WCS 1.1.1 spec AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute(null, "name", "name", null, "PostEncoding"); start("ows:Constraint", attributes); start("ows:AllowedValues"); element("ows:Value", "XML"); end("ows:AllowedValues"); end("ows:Constraint"); end("ows:OperationsMetadata"); }
/** * Handles the OperationMetadata portion of the document, printing out * the operations and where to bind to them. * * @param config * The global wms. * * @throws SAXException * For any problems. */ private void handleOperationsMetadata() { start("ows:OperationsMetadata"); handleOperation("GetCapabilities", null); handleOperation("DescribeCoverage", null); handleOperation("GetCoverage", new HashMap<String, List<String>>() { { put("store", Arrays.asList("True", "False")); } }); // specify that we do support xml post encoding, clause 8.3.2.2 of // the WCS 1.1.1 spec AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute(null, "name", "name", null, "PostEncoding"); start("ows:Constraint", attributes); start("ows:AllowedValues"); element("ows:Value", "XML"); end("ows:AllowedValues"); end("ows:Constraint"); end("ows:OperationsMetadata"); }
elementIfNotEmpty("ows:Voice", contact.getContactVoice()); elementIfNotEmpty("ows:Facsimile", contact.getContactFacsimile()); end("ows:Phone"); start("ows:Address"); elementIfNotEmpty("ows:DeliveryPoint", contact.getAddress()); elementIfNotEmpty("ows:Country", contact.getAddressCountry()); elementIfNotEmpty("ows:ElectronicMailAddress", contact.getContactEmail()); end("ows:Address"); attributes.addAttribute("", "xlink:href", "xlink:href", "", or); start("ows:OnlineResource", attributes); end("OnlineResource"); end("ows:ContactInfo"); end("ows:ServiceContact");
/** * Handles the service identification of the capabilities document. * * @param config The OGC service to transform. * @throws SAXException For any errors. */ protected void handleServiceIdentification() { start("ows:ServiceIdentification"); element("ows:Title", wcs.getTitle()); element("ows:Abstract", wcs.getAbstract()); handleKeywords(wcs.getKeywords()); element("ows:ServiceType", "WCS"); element("ows:ServiceTypeVersion", "1.1.0"); element("ows:ServiceTypeVersion", "1.1.1"); String fees = wcs.getFees(); if ((fees == null) || "".equals(fees)) { fees = "NONE"; } element("ows:Fees", fees); String accessConstraints = wcs.getAccessConstraints(); if ((accessConstraints == null) || "".equals(accessConstraints)) { accessConstraints = "NONE"; } element("ows:AccessConstraints", accessConstraints); end("ows:ServiceIdentification"); }
attributes.addAttribute("", "xlink:href", "xlink:href", "", url); element("ows:Get", null, attributes); end("ows:HTTP"); end("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); end("ows:DCP"); element("ows:Value", value); end("ows:AllowedValues"); end("ows:Parameter"); end("ows:Operation");
/** * Handles the service identification of the capabilities document. * * @param config * The OGC service to transform. * * @throws SAXException * For any errors. */ private void handleServiceIdentification() { start("ows:ServiceIdentification"); element("ows:Title", wcs.getTitle()); element("ows:Abstract", wcs.getAbstract()); handleKeywords(wcs.getKeywords()); element("ows:ServiceType", "WCS"); element("ows:ServiceTypeVersion", "1.1.0"); element("ows:ServiceTypeVersion", "1.1.1"); String fees = wcs.getFees(); if ((fees == null) || "".equals(fees)) { fees = "NONE"; } element("ows:Fees", fees); String accessConstraints = wcs.getAccessConstraints(); if ((accessConstraints == null) || "".equals(accessConstraints)) { accessConstraints = "NONE"; } element("ows:AccessConstraints", accessConstraints); end("ows:ServiceIdentification"); }
/** * Handles the service provider of the capabilities document. * * @param config The OGC service to transform. * @throws SAXException For any errors. */ protected 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"); }
/** * 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"); element("ows:ProviderName", wcs.getGeoServer().getContactOrganization()); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", wcs.getGeoServer() .getOnlineResource()); element("ows:ProviderSite", null, attributes); handleContact(); end("ows:ServiceProvider"); }
protected void handleEnvelope(ReferencedEnvelope envelope) { start("ows:WGS84BoundingBox"); element( "ows:LowerCorner", new StringBuffer(Double.toString(envelope.getLowerCorner().getOrdinate(0))) .append(" ") .append(envelope.getLowerCorner().getOrdinate(1)) .toString()); element( "ows:UpperCorner", new StringBuffer(Double.toString(envelope.getUpperCorner().getOrdinate(0))) .append(" ") .append(envelope.getUpperCorner().getOrdinate(1)) .toString()); end("ows:WGS84BoundingBox"); }
private void handleEnvelope(GeneralEnvelope envelope) { start("ows:WGS84BoundingBox"); element("ows:LowerCorner", new StringBuffer(Double.toString(envelope.getLowerCorner() .getOrdinate(0))).append(" ").append(envelope.getLowerCorner().getOrdinate(1)) .toString()); element("ows:UpperCorner", new StringBuffer(Double.toString(envelope.getUpperCorner() .getOrdinate(0))).append(" ").append(envelope.getUpperCorner().getOrdinate(1)) .toString()); end("ows:WGS84BoundingBox"); }
private void handleCoverageSummary(CoverageInfo cv) { start("wcs:CoverageSummary"); elementIfNotEmpty("ows:Title", cv.getLabel()); elementIfNotEmpty("ows:Abstract", cv.getDescription()); handleKeywords(cv.getKeywords()); handleMetadataLink(cv.getMetadataLink(), "simple"); handleEnvelope(cv.getWGS84LonLatEnvelope()); element("wcs:Identifier", cv.getName()); end("wcs:CoverageSummary"); }
protected void handleCoverageSummary(CoverageInfo cv) { start("wcs:CoverageSummary"); elementIfNotEmpty("ows:Title", cv.getTitle()); elementIfNotEmpty("ows:Abstract", cv.getDescription()); handleKeywords(cv.getKeywords()); handleMetadataLinks(cv.getMetadataLinks(), "simple"); handleEnvelope(cv.getLatLonBoundingBox()); element("wcs:Identifier", cv.prefixedName()); end("wcs:CoverageSummary"); }