private List<String> getAvailableWFSFormats() { List<String> formats = new ArrayList<String>(); final GeoServerApplication application = getGeoServerApplication(); for (WFSGetFeatureOutputFormat producer : application.getBeansOfType(WFSGetFeatureOutputFormat.class)) { for (String format : producer.getOutputFormats()) { formats.add(format); } } prepareFormatList(formats, new FormatComparator("format.wfs.")); return formats; }
private String translateFormat(String prefix, String format) { try { return getLocalizer().getString(prefix + format, this); } catch (Exception e) { LOGGER.log(Level.WARNING, e.getMessage()); return format; } }
public MapPreviewPage() { final List<String> wmsOutputFormats = getAvailableWMSFormats(); final List<String> wfsOutputFormats = getAvailableWFSFormats(); add(table);
final GeoServerApplication application = getGeoServerApplication(); final List<GetMapOutputFormat> outputFormats; outputFormats = application.getBeansOfType(GetMapOutputFormat.class); String knownFormat = producer.getMimeType(); for (String formatName : producerFormats) { String translatedFormatName = translateFormat("format.wms.", formatName); if (!formatName.equals(translatedFormatName)) { knownFormat = formatName; prepareFormatList(formats, new FormatComparator("format.wms.")); this.availableWMSFormats = formats; return formats;
for (int i = 0; i < wmsOutputFormats.size(); i++) { String wmsOutputFormat = wmsOutputFormats.get(i); String label = translateFormat("format.wms.", wmsOutputFormat); for (int i = 0; i < wfsOutputFormats.size(); i++) { String wfsOutputFormat = wfsOutputFormats.get(i); String label = translateFormat("format.wfs.", wfsOutputFormat); "'" + layer.buildWfsLink() + getMaxFeatures() + "&outputFormat=' + this.options[this.selectedIndex].value"; String choice =
/** * Generates the maxFeatures element of the WFS request using the value of * maxNumberOfFeaturesForPreview. Values <= 0 give no limit. * * @return "&maxFeatures=${maxNumberOfFeaturesForPreview}" or "" if * maxNumberOfFeaturesForPreview <= 0" */ private String getMaxFeatures() { GeoServer geoserver = getGeoServer(); WFSInfo service = geoserver.getService(WFSInfo.class); if (service.getMaxNumberOfFeaturesForPreview() > 0) { return "&maxFeatures=" + service.getMaxNumberOfFeaturesForPreview(); } return ""; }