delegate.addExtensionSchemaLocation(schemaLocation); delegate.serviceIdentification("2.0.0"); delegate.serviceProvider(wfs.getGeoServer());
if (featureType.enabled()) { try { mark(); featureType(featureType, crs); commit(); } catch (RuntimeException ex) { if (skipMisconfigured) { reset(); LOGGER.log( Level.WARNING,
boolean get, boolean post) { start("ows:Operation", attributes(new String[] {"name", name})); String serviceURL = buildURL(request.getBaseUrl(), "wfs", null, URLType.SERVICE); dcp(serviceURL, get, post); String[] pvalues = (String[]) parameters[i].getValue(); start("ows:Parameter", attributes(new String[] {"name", pname})); element("ows:Value", pvalues[j]); end("ows:Parameter"); String[] cvalues = (String[]) constraints[i].getValue(); start("ows:Constraint", attributes(new String[] {"name", cname})); element("ows:Value", cvalues[j]); end("ows:Constraint"); end("ows:Operation");
start("FeatureType", attributes(new String[] {"xmlns:" + prefix, uri})); element("Name", featureType.getPrefixedName()); element("Title", featureType.getTitle()); element("Abstract", featureType.getAbstract()); keywords(featureType.getKeywords()); srs = applySRSNameStyle(gml, srs); element("DefaultCRS", srs); } else { element("DefaultSRS", srs); List<String> otherSRSes = getOtherSRS(featureType); for (String otherSRS : otherSRSes) { if (otherSRS != null) { otherSRS = applySRSNameStyle(gml, otherSRS); if (!otherSRS.equals(srs)) { if (crs) { element("OtherCRS", otherSRS); } else { element("OtherSRS", otherSRS); start("ows:WGS84BoundingBox"); element("ows:LowerCorner", bbox.getMinX() + " " + bbox.getMinY()); element("ows:UpperCorner", bbox.getMaxX() + " " + bbox.getMaxY()); end("ows:WGS84BoundingBox");
start("ows:ServiceProvider"); element("ows:ProviderName", contact.getContactOrganization()); start("ows:ServiceContact"); element("ows:IndividualName", contact.getContactPerson()); element("ows:PositionName", contact.getContactPosition()); start("ows:ContactInfo"); start("ows:Phone"); element("ows:Voice", contact.getContactVoice()); element("ows:Facsimile", contact.getContactFacsimile()); end("ows:Phone"); start("ows:Address"); element("ows:DeliveryPoint", contact.getAddressDeliveryPoint()); element("ows:City", contact.getAddressCity()); element("ows:AdministrativeArea", contact.getAddressState()); element("ows:PostalCode", contact.getAddressPostalCode()); element("ows:Country", contact.getAddressCountry()); element("ows:ElectronicMailAddress", contact.getContactEmail()); end("ows:Address"); end("ows:ContactInfo"); end("ows:ServiceContact");
start("ogc:Filter_Capabilities"); start("ogc:Spatial_Capabilities"); start("ogc:GeometryOperands"); element("ogc:GeometryOperand", "gml:Envelope"); element("ogc:GeometryOperand", "gml:Point"); element("ogc:GeometryOperand", "gml:LineString"); element("ogc:GeometryOperand", "gml:Polygon"); end("ogc:GeometryOperands"); start("ogc:SpatialOperators"); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Disjoint"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Equals"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "DWithin"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Beyond"})); element( "ogc:SpatialOperator", null, attributes(new String[] {"name", "Intersects"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Touches"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Crosses"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Within"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Contains"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "Overlaps"})); element("ogc:SpatialOperator", null, attributes(new String[] {"name", "BBOX"})); end("ogc:SpatialOperators"); end("ogc:Spatial_Capabilities");
buildSchemaURL(request.getBaseUrl(), "wfs/1.1.0/wfs.xsd")); addExtensionSchemaLocation(schemaLocation); Enumeration prefixes = getNamespaceSupport().getPrefixes(); while (prefixes.hasMoreElements()) { String prefix = (String) prefixes.nextElement(); "xmlns:" + prefix, null, getNamespaceSupport().getURI(prefix)); start("wfs:WFS_Capabilities", attributes); serviceIdentification(); serviceProvider(wfs.getGeoServer()); operationsMetadata(); featureTypeList(); filterCapabilities(); end("wfs:WFS_Capabilities");
start("ows:OperationsMetadata"); operations.add(getCapabilities()); operations.add(describeFeatureType()); operations.add(getFeature()); operations.add(getGmlObject()); operations.add(lockFeature()); operations.add(getFeatureWithLock()); operations.add(transaction()); operations.forEach(o -> operation(o)); extendedCapabilities(); end("ows:OperationsMetadata");
start("FeatureTypeList"); start("Operations"); element("Operation", "Query"); .getOps() .contains(WFSInfo.Operation.TRANSACTION_INSERT))) { element("Operation", "Insert"); .getOps() .contains(WFSInfo.Operation.TRANSACTION_UPDATE))) { element("Operation", "Update"); .getOps() .contains(WFSInfo.Operation.TRANSACTION_DELETE))) { element("Operation", "Delete"); element("Operation", "Lock"); end("Operations"); featureTypes(); end("FeatureTypeList");
element( "MetadataURL", ResponseUtils.proxifyMetadataLink(link, request.getBaseUrl()),
protected void operationsMetadata() { start("ows:OperationsMetadata"); // setup basic operations List<OperationMetadata> operations = new ArrayList<>(); operations.add(getCapabilities()); operations.add(describeFeatureType()); operations.add(getFeature()); operations.add(getPropertyValue()); operations.add(listStoredQueries()); operations.add(describeStoredQueries()); operations.add(createStoredQuery()); operations.add(dropStoredQuery()); if (wfs.getServiceLevel().contains(WFSInfo.ServiceLevel.COMPLETE)) { operations.add(lockFeature()); operations.add(getFeatureWithLock()); } if (wfs.getServiceLevel().contains(WFSInfo.ServiceLevel.TRANSACTIONAL)) { operations.add(transaction()); } // allow extension points to manipulate/modify the list for (WFSExtendedCapabilitiesProvider provider : extCapsProviders) { provider.updateOperationMetadata(VERSION_20, operations); } // declare metadata for each operation operations.forEach(o -> operation(o)); constraints(); delegate.extendedCapabilities(); end("ows:OperationsMetadata"); }
/** * Encodes the ows:Keywords element. * * <p> * * <pre> * <complexType name="KeywordsType"> * <annotation> * <documentation>Unordered list of one or more commonly used or formalised word(s) or phrase(s) used to describe the subject. When needed, the optional "type" can name the type of the associated list of keywords that shall all have the same type. Also when needed, the codeSpace attribute of that "type" can reference the type name authority and/or thesaurus. </documentation> * <documentation>For OWS use, the optional thesaurusName element was omitted as being complex information that could be referenced by the codeSpace attribute of the Type element. </documentation> * </annotation> * <sequence> * <element name="Keyword" type="string" maxOccurs="unbounded"/> * <element name="Type" type="ows:CodeType" minOccurs="0"/> * </sequence> * </complexType> * </pre> * * @param keywords */ protected void keywords(KeywordInfo[] keywords) { if ((keywords == null) || (keywords.length == 0)) { return; } start("ows:Keywords"); for (int i = 0; i < keywords.length; i++) { element("ows:Keyword", keywords[i].getValue()); } end("ows:Keywords"); }
protected void serviceIdentification(String version) { start("ows:ServiceIdentification"); element("ows:Title", wfs.getTitle()); element("ows:Abstract", wfs.getAbstract()); keywords(wfs.getKeywords()); element("ows:ServiceType", "WFS"); element("ows:ServiceTypeVersion", version); // advertise eventual profiles that might be implemented (only since OWS 1.1, thus // WFS 2.0) Version gtVersion = new Version(version); if (gtVersion.compareTo(new Version("2")) >= 0) { LinkedHashSet<String> profiles = new LinkedHashSet<>(); for (WFSExtendedCapabilitiesProvider provider : extCapsProviders) { List<String> providerProfiles = provider.getProfiles(gtVersion); profiles.addAll(providerProfiles); } for (String profile : profiles) { element("ows:Profile", profile); } } element("ows:Fees", wfs.getFees()); element("ows:AccessConstraints", wfs.getAccessConstraints()); end("ows:ServiceIdentification"); }
/** * Encodes the wfs:SupportsGMLObjectTypeList element. * * <p> * * <pre> * <xsd:complexType name="GMLObjectTypeListType"> * <xsd:sequence> * <xsd:element name="GMLObjectType" type="wfs:GMLObjectTypeType" * maxOccurs="unbounded"> * <xsd:annotation> * <xsd:documentation> * Name of this GML object type, including any namespace prefix * </xsd:documentation> * </xsd:annotation> * </xsd:element> * </xsd:sequence> * </xsd:complexType> * </pre> */ protected void supportsGMLObjectTypeList() { element("SupportsGMLObjectTypeList", null); }
protected void operation(OperationMetadata operation) { start("ows:Operation", attributes(new String[] {"name", operation.getName()})); String serviceURL = buildURL(request.getBaseUrl(), "wfs", null, URLType.SERVICE); // dcp dcp(serviceURL, operation.isGet(), operation.isPost()); // parameters for (DomainType parameter : operation.getParameters()) { domainType("ows:Parameter", parameter); } // constraints for (DomainType constraint : operation.getConstraints()) { domainType("ows:Constraint", constraint); } end("ows:Operation"); }
public Translator createTranslator(ContentHandler handler) { return new CapabilitiesTranslator1_1(handler, baseUrl, wfs, extCapsProviders); }
protected void operation(OperationMetadata operation) { start("ows:Operation", attributes(new String[] {"name", operation.getName()})); String serviceURL = buildURL(request.getBaseUrl(), "wfs", null, URLType.SERVICE); // dcp delegate.dcp(serviceURL, operation.isGet(), operation.isPost()); // parameters for (DomainType parameter : operation.getParameters()) { domainType("ows:Parameter", parameter); } // constraints for (DomainType constraint : operation.getConstraints()) { domainType("ows:Constraint", constraint); } end("ows:Operation"); }
protected void functions() { start("ogc:Functions"); Set<FunctionName> functions = getAvailableFunctionNames(); if (!functions.isEmpty()) { start("ogc:FunctionNames"); for (FunctionName fe : functions) { element( "ogc:FunctionName", fe.getName(), attributes(new String[] {"nArgs", "" + fe.getArgumentCount()})); } end("ogc:FunctionNames"); } end("ogc:Functions"); }
protected void domainType(String elementName, DomainType domainType) { start(elementName, attributes(new String[] {"name", domainType.getName()})); if (domainType.getDefaultValue() != null) { element("ows:Value", domainType.getDefaultValue()); } if (!domainType.getAllowedValues().isEmpty()) { for (String v : domainType.getAllowedValues()) { element("ows:Value", v); } } end(elementName); } }
protected void dcp(String serviceURL, boolean get, boolean post) { start("ows:DCP"); start("ows:HTTP"); if (get) { element("ows:Get", null, attributes(new String[] {"xlink:href", serviceURL})); } if (post) { element("ows:Post", null, attributes(new String[] {"xlink:href", serviceURL})); } end("ows:HTTP"); end("ows:DCP"); }