@Override protected void wrapInternal(Map properties, SimpleHash model, WFSInfo wfsInfo) { WorkspaceInfo workspaceInfo = wfsInfo.getWorkspace(); properties.put("workspaceName", workspaceInfo != null ? workspaceInfo.getName() : "NO_WORKSPACE"); properties.put("enabled", wfsInfo.isEnabled() ? "true" : "false"); properties.put("name", wfsInfo.getName()); properties.put("title", wfsInfo.getTitle()); properties.put("maintainer", wfsInfo.getMaintainer()); properties.put("abstract", wfsInfo.getAbstract()); properties.put("accessConstraints", wfsInfo.getAccessConstraints()); properties.put("fees", wfsInfo.getFees()); properties.put("versions", wfsInfo.getVersions()); properties.put("keywords", wfsInfo.getKeywords()); properties.put("metadataLink", wfsInfo.getMetadataLink()); properties.put("citeCompliant", wfsInfo.isCiteCompliant() ? "true" : "false"); properties.put("onlineResource", wfsInfo.getOnlineResource()); properties.put("schemaBaseURL", wfsInfo.getSchemaBaseURL()); properties.put("verbose", wfsInfo.isVerbose() ? "true" : "false"); properties.put("maxFeatures", String.valueOf(wfsInfo.getMaxFeatures())); properties.put("isFeatureBounding", wfsInfo.isFeatureBounding() ? "true" : "false"); properties.put("serviceLevel", wfsInfo.getServiceLevel()); properties.put("isCanonicalSchemaLocation", wfsInfo.isCanonicalSchemaLocation() ? "true" : "false"); properties.put("encodeFeatureMember", wfsInfo.isEncodeFeatureMember() ? "true" : "false"); } });
/** Encodes the GetFeature ows:Operation element. */ protected OperationMetadata getFeature() { String[] formats = getAvailableOutputFormatNames(GML32_FORMAT); OperationMetadata operation = new OperationMetadata("GetFeature", true, true); operation .getParameters() .add(new DomainType("resultType", new String[] {"results", "hits"})); operation.getParameters().add(new DomainType("outputFormat", formats)); operation.getConstraints().add(new DomainType("PagingIsTransactionSafe", FALSE)); operation .getConstraints() .add(new DomainType("CountDefault", String.valueOf(wfs.getMaxFeatures()))); operation .getParameters() .add(new DomainType("resolve", new String[] {"none", "local"})); return operation; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof WFSInfo)) return false; final WFSInfo other = (WFSInfo) obj; if (gml == null) { if (other.getGML() != null) return false; } else if (!gml.equals(other.getGML())) return false; if (maxFeatures != other.getMaxFeatures()) return false; if (featureBounding != other.isFeatureBounding()) return false; if (canonicalSchemaLocation != other.isCanonicalSchemaLocation()) return false; if (serviceLevel == null) { if (other.getServiceLevel() != null) return false; } else if (!serviceLevel.equals(other.getServiceLevel())) return false; if (encodeFeatureMember != other.isEncodeFeatureMember()) return false; if (hitsIgnoreMaxFeatures != other.isHitsIgnoreMaxFeatures()) return false; if (srs == null) { if (other.getSRS() != null) return false; } else if (!srs.equals(other.getSRS())) return false; return true; } }
if (wfs.getMaxFeatures() > 0) { limitMax = BigDecimal.valueOf(wfs.getMaxFeatures()); } else { limitMax = BigDecimal.valueOf(Integer.MAX_VALUE);
int maxFeatures = Math.min(request.getMaxFeatures().intValue(), wfs.getMaxFeatures());
@Test public void testResultTypeHitsNumberMatched() throws Exception { WFSInfo wfs = getWFS(); int oldMaxFeatures = wfs.getMaxFeatures(); boolean hitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures();
@Test public void testNumReturnedMatchedWithMaxFeatures() throws Exception { WFSInfo wfs = getWFS(); int oldMaxFeatures = wfs.getMaxFeatures(); boolean oldHitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures(); try { wfs.setMaxFeatures(1); wfs.setHitsIgnoreMaxFeatures(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=results&service=wfs"); assertGML32(doc); assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched")); assertEquals("1", doc.getDocumentElement().getAttribute("numberReturned")); } finally { wfs.setMaxFeatures(oldMaxFeatures); wfs.setHitsIgnoreMaxFeatures(oldHitsIgnoreMaxFeatures); getGeoServer().save(wfs); } }
public void testValues() throws Exception { WFSInfo wfs = getGeoServerApplication().getGeoServer().getService(WFSInfo.class); login(); tester.startPage(WFSAdminPage.class); tester.assertModelValue("form:maxFeatures", wfs.getMaxFeatures()); tester.assertModelValue("form:keywords", wfs.getKeywords()); } }
assertEquals(BigDecimal.valueOf(1), limitSchema.getMinimum()); WFSInfo wfs = getGeoServer().getService(WFSInfo.class); assertEquals(wfs.getMaxFeatures(), limitSchema.getMaximum().intValue()); assertEquals(wfs.getMaxFeatures(), ((Number) limitSchema.getDefault()).intValue());
@Test public void testValues() throws Exception { WFSInfo wfs = getGeoServerApplication().getGeoServer().getService(WFSInfo.class); login(); tester.startPage(WFSAdminPage.class); tester.assertModelValue("form:maxFeatures", wfs.getMaxFeatures()); tester.assertModelValue( "form:maxNumberOfFeaturesForPreview", wfs.getMaxNumberOfFeaturesForPreview()); tester.assertModelValue("form:keywords", wfs.getKeywords()); }