protected WFSInfo createServiceFromScratch(GeoServer gs) { WFSInfoImpl wfs = new WFSInfoImpl(); wfs.setName("WFS"); wfs.setMaxFeatures(1000000); // gml2 addGml(wfs, WFSInfo.Version.V_10, GMLInfo.SrsNameStyle.XML, true); // gml3 addGml(wfs, WFSInfo.Version.V_11, GMLInfo.SrsNameStyle.URN, false); // gml3.2 addGml(wfs, WFSInfo.Version.V_20, SrsNameStyle.URN2, false); return wfs; }
@Override public Integer getMaxNumberOfFeaturesForPreview() { Integer i = getMetadata().get("maxNumberOfFeaturesForPreview", Integer.class); return i != null ? i : 50; }
public WFSInfo load(LegacyServicesReader reader, GeoServer geoServer) throws Exception { WFSInfoImpl wfs = new WFSInfoImpl(); wfs.setId("wfs"); wfs.setServiceLevel(WFSInfo.ServiceLevel.get((Integer) properties.get("serviceLevel"))); maxFeatures = Integer.MAX_VALUE; wfs.setMaxFeatures(maxFeatures); wfs.setFeatureBounding(featureBounding); wfs.setHitsIgnoreMaxFeatures(hitsIgnoreMaxFeatures); wfs.getGML().put(WFSInfo.Version.V_10, gml); gml.setSrsNameStyle(SrsNameStyle.URN); gml.setOverrideGMLAttributes(false); wfs.getGML().put(WFSInfo.Version.V_11, gml); gml.setSrsNameStyle(SrsNameStyle.URN2); gml.setOverrideGMLAttributes(false); wfs.getGML().put(WFSInfo.Version.V_20, gml); wfs.getVersions().add(new Version("1.0.0")); wfs.getVersions().add(new Version("1.1.0")); wfs.getVersions().add(new Version("2.0.0"));
private void addDefaultsIfMissing(ServiceInfo serviceInfo) { if (serviceInfo instanceof WMSInfoImpl) { WMSInfoImpl wmsInfo = (WMSInfoImpl) serviceInfo; if (wmsInfo.getAuthorityURLs() == null) { List<AuthorityURLInfo> authorityURLS = new ArrayList<AuthorityURLInfo>(); wmsInfo.setAuthorityURLs(authorityURLS); } if (wmsInfo.getIdentifiers() == null) { List<LayerIdentifierInfo> identifiers = new ArrayList<LayerIdentifierInfo>(); wmsInfo.setIdentifiers(identifiers); } if (wmsInfo.getSRS() == null) { List<String> srsList = new ArrayList<String>(); wmsInfo.setSRS(srsList); } } else if (serviceInfo instanceof WFSInfoImpl) { WFSInfoImpl wfsInfo = (WFSInfoImpl) serviceInfo; if (wfsInfo.getGML() == null) { GMLInfoImpl gml3Info = new GMLInfoImpl(); gml3Info.setOverrideGMLAttributes(true); Map<WFSInfo.Version, GMLInfo> gml = new HashMap<WFSInfo.Version, GMLInfo>(); wfsInfo.setGML(gml); wfsInfo.getGML().put(WFSInfo.Version.V_11, gml3Info); wfsInfo.getGML().put(WFSInfo.Version.V_10, gml3Info); wfsInfo.getGML().put(WFSInfo.Version.V_20, gml3Info); } } }
@Override public <T> T create(Class<T> clazz) { return (T) new WFSInfoImpl(); } }
@Override public void setMaxNumberOfFeaturesForPreview(Integer maxNumberOfFeaturesForPreview) { getMetadata().put("maxNumberOfFeaturesForPreview", maxNumberOfFeaturesForPreview); }