private DomainType getTimeoutParameter(WFSInfo wfs) { Integer timeout = wfs.getMetadata().get(TimeoutCallback.TIMEOUT_CONFIG_KEY, Integer.class); if (timeout == null) { timeout = 300; } DomainType result = new DomainType("Timeout", String.valueOf(timeout)); return result; }
if (null == requestedPrjFileFormat) { WFSInfo bean = gs.getService(WFSInfo.class); MetadataMap metadata = bean.getMetadata(); Boolean defaultIsEsri = metadata.get(SHAPE_ZIP_DEFAULT_PRJ_IS_ESRI, Boolean.class); useEsriFormat = defaultIsEsri != null && defaultIsEsri.booleanValue();
private long getTimeoutMilliseconds(Operation operation) { // check if there is a timeout parameter Object[] parameters = operation.getParameters(); if (parameters != null && parameters.length > 0 && parameters[0] instanceof BaseRequestType) { BaseRequestType request = (BaseRequestType) parameters[0]; Object timeout = request.getExtendedProperties().get(TIMEOUT_REQUEST_ATTRIBUTE); if (timeout != null) { Long converted = Converters.convert(timeout, Long.class); if (converted != null && converted > 0) { return converted * 1000l; } else { throw new WFSException(request, "Invalid timeout value: " + timeout); } } } // use the configured default WFSInfo wfs = gs.getService(WFSInfo.class); Integer timeoutSeconds = wfs.getMetadata().get(TIMEOUT_CONFIG_KEY, Integer.class); return Optional.ofNullable(timeoutSeconds).orElse(TIMEOUT_CONFIG_DEFAULT) * 1000L; } }
public void setupInspireExtensions() { // prepare read only metadata final WFSInfo wfs = getGeoServer().getService(WFSInfo.class); wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_TYPE.key, "application/vnd.iso.19139+xml"); wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key, "one,http://www.geoserver.org/one;two,http://www.geoserver.org/two"); getGeoServer().save(wfs); tester.startPage(new FormTestPage(new ComponentBuilder() { public Component buildComponent(String id) { return new InspireAdminPanel(id, new Model(wfs)); } })); }
private void setupESRIFormatByDefault(GeoServer geoServer, Boolean value) throws IOException { WFSInfo wfsInfo = geoServer.getService(WFSInfo.class); MetadataMap metadata = wfsInfo.getMetadata(); metadata.put(ShapeZipOutputFormat.SHAPE_ZIP_DEFAULT_PRJ_IS_ESRI, value); geoServer.save(wfsInfo); }
public void testChangeMediaType() throws Exception { WFSInfo wfs = getGeoServer().getService(WFSInfo.class); wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); getGeoServer().save(wfs); Document dom = getAsDOM("wfs?request=getcapabilities&service=wfs&version=1.1.0"); // print(dom); assertEquals(DLS_NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_dls")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/vnd.ogc.csw.GetRecordByIdResponse_xml"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_TYPE.key, "application/xml"); getGeoServer().save(wfs); dom = getAsDOM("wfs?request=getcapabilities&service=wfs&version=1.1.0"); assertEquals(DLS_NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_dls")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/xml"); }
public void setTimeout(int timeout) { GeoServer gs = getGeoServer(); WFSInfo wfs = gs.getService(WFSInfo.class); wfs.getMetadata().put(TimeoutCallback.TIMEOUT_CONFIG_KEY, timeout); gs.save(wfs); }
public void clearMetadata() { WFSInfo wfs = getGeoServer().getService(WFSInfo.class); wfs.getMetadata().clear(); getGeoServer().save(wfs); }
public void testExtendedCaps200() throws Exception { WFSInfo wfs = getGeoServer().getService(WFSInfo.class); wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key, "one,http://www.geoserver.org/inspire/one"); getGeoServer().save(wfs);
public void testExtendedCaps110() throws Exception { WFSInfo wfs = getGeoServer().getService(WFSInfo.class); wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key, "codeOnly"); getGeoServer().save(wfs);