/** * 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 (content != null && !"".equals(content.trim())) element(elementName, content); } }
/** * DOCUMENT ME! * * @param kwords DOCUMENT ME! * @throws SAXException DOCUMENT ME! */ private void handleKeywords(List kwords) { if (kwords == null || kwords.isEmpty()) { return; } start("wcs:keywords"); if (kwords != null) { for (Iterator it = kwords.iterator(); it.hasNext(); ) { element("wcs:keyword", it.next().toString()); } } end("wcs:keywords"); }
element("wcs:individualName", tmp); } else { element("wcs:individualName", ""); element("wcs:organisationName", tmp); element("wcs:positionName", tmp); element("wcs:voice", tmp); element("wcs:facsimile", tmp); element("wcs:deliveryPoint", tmp + " " + addr); element("wcs:deliveryPoint", tmp); element("wcs:city", tmp); element("wcs:administrativeArea", tmp); element("wcs:postalCode", tmp); element("wcs:country", tmp); element("wcs:electronicMailAddress", tmp);
handleMetadataLink(wcs.getMetadataLink(), "simple"); element("wcs:description", wcs.getAbstract()); element("wcs:name", wcs.getName()); element("wcs:label", wcs.getTitle()); handleKeywords(wcs.getKeywords()); handleContact(); element("wcs:fees", fees); element("wcs:accessConstraints", accessConstraints); end("wcs:Service");
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); } }
/** * Handles the printing of the exceptions information, prints the formats that GeoServer can * return exceptions in. * * @param config The wms service global config. * @throws SAXException For any problems. */ private void handleExceptions() { start("wcs:Exception"); final List<String> exceptionFormats = wcs.getExceptionFormats(); if (exceptionFormats == null || exceptionFormats.isEmpty()) { exceptionFormats.add("application/vnd.ogc.se_xml"); } for (String format : exceptionFormats) { element("wcs:Format", format); } end("wcs:Exception"); }