/** * 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"); }
attributes.addAttribute( "", "updateSequence", "updateSequence", "", String.valueOf(updateSequence)); start("wcs:Capabilities", attributes);
attributes.addAttribute("", "updateSequence", "updateSequence", "", String .valueOf(updateSequence)); start("wcs:Capabilities", attributes);
protected void handleContents() { start("wcs:Contents");
AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute(null, "name", "name", null, capabilityName); start("ows:Operation", attributes); buildURL(request.getBaseUrl(), "wcs", null, URLType.SERVICE), ""); start("ows:DCP"); start("ows:HTTP"); attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", url); start("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); 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);
start("ows:ServiceContact"); start("ows:ContactInfo"); start("ows:Phone"); elementIfNotEmpty("ows:Voice", gs.getContactVoice()); elementIfNotEmpty("ows:Facsimile", gs.getContactFacsimile()); end("ows:Phone"); start("ows:Address"); elementIfNotEmpty("ows:DeliveryPoint", gs.getAddress()); elementIfNotEmpty("ows:City", gs.getAddressCity()); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", or); start("ows:OnlineResource", attributes); end("OnlineResource");
/** * 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"); }
start("ows:ServiceContact"); 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()); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", or); start("ows:OnlineResource", attributes); end("OnlineResource");
/** * 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"); }
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); start("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); 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);
/** * 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"); }