/// <summary> /// Protected constructor for the abstract class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param> protected GeometryFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) { FeatureTypeInfo = featureTypeInfo; _httpClientUtil = httpClientUtil; CreateReader(httpClientUtil); try { if (featureTypeInfo.LableField != null) { LabelNode = new PathNode(FeatureTypeInfo.FeatureTypeNamespace, featureTypeInfo.LableField, (NameTable) XmlReader.NameTable); } } catch (Exception ex) { Trace.TraceError("An exception occured while initializing the label path node! " + ex.Message); throw; } InitializePathNodes(); InitializeSeparators(); }
/// <summary> /// This method invokes the corresponding method of the inherent <see cref="IXPathQueryManager"/> instance. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> public virtual void SetDocumentToParse(HttpClientUtil httpClientUtil) { XPathQueryManager.SetDocumentToParse(httpClientUtil); }
/// <summary> /// Initializes a new instance of the <see cref="XPathQueryManager"/> class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> public XPathQueryManager(HttpClientUtil httpClientUtil) { SetDocumentToParse(httpClientUtil); }
/// <summary> /// Sets a new XML document. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> public void SetDocumentToParse(HttpClientUtil httpClientUtil) { try { InitializeXPathObjects(httpClientUtil.GetDataStream()); } finally { httpClientUtil.Close(); } }
/// <summary> /// Configures for WFS 'GetFeature' request using an instance implementing <see cref="IWFS_TextResources"/>. /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. /// </summary> internal void ConfigureForWfsGetFeatureRequest(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo, string labelProperty, BoundingBox boundingBox, IFilter filter, bool get) { httpClientUtil.Reset(); httpClientUtil.Url = featureTypeInfo.ServiceUri; if (get) { /* HTTP-GET */ httpClientUtil.Url += _wfsTextResources.GetFeatureGETRequest( featureTypeInfo, labelProperty, boundingBox, filter); } /* HTTP-POST */ httpClientUtil.PostData = _wfsTextResources.GetFeaturePOSTRequest( featureTypeInfo, labelProperty, boundingBox, filter); httpClientUtil.AddHeader(HttpRequestHeader.ContentType.ToString(), "text/xml"); }
/// <summary> /// Configures for WFS 'GetCapabilities' request using an instance implementing <see cref="IWFS_TextResources"/>. /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. /// </summary> internal HttpClientUtil ConfigureForWfsGetCapabilitiesRequest(HttpClientUtil httpClientUtil, string targetUrl) { httpClientUtil.Reset(); httpClientUtil.Url = targetUrl + _wfsTextResources.GetCapabilitiesRequest(); return httpClientUtil; }
/// <summary> /// Configures for WFS 'DescribeFeatureType' request using an instance implementing <see cref="IWFS_TextResources"/>. /// The <see cref="HttpClientUtil"/> instance is returned for immediate usage. /// </summary> internal HttpClientUtil ConfigureForWfsDescribeFeatureTypeRequest(HttpClientUtil httpClientUtil, string targetUrl, string featureTypeName) { httpClientUtil.Reset(); httpClientUtil.Url = targetUrl + _wfsTextResources.DescribeFeatureTypeRequest(featureTypeName); return httpClientUtil; }
/// <summary> /// Initializes a new instance of the <see cref="UnspecifiedGeometryFactory_WFS1_0_0_GML2"/> class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param> /// <param name="multiGeometries">A boolean value specifying whether multi-geometries should be created</param> /// <param name="quickGeometries">A boolean value specifying whether the factory should create geometries quickly, but without validation</param> internal UnspecifiedGeometryFactory_WFS1_0_0_GML2(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo, bool multiGeometries, bool quickGeometries) : base(httpClientUtil, featureTypeInfo) { _httpClientUtil = httpClientUtil; _multiGeometries = multiGeometries; _quickGeometries = quickGeometries; }
/// <summary> /// Initializes a new instance of the <see cref="MultiPolygonFactory"/> class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param> internal MultiPolygonFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) : base(httpClientUtil, featureTypeInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="MultiLineStringFactory"/> class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param> internal MultiLineStringFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) : base(httpClientUtil, featureTypeInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="PointFactory"/> class. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param> internal PointFactory(HttpClientUtil httpClientUtil, WfsFeatureTypeInfo featureTypeInfo) : base(httpClientUtil, featureTypeInfo) { }
/// <summary> /// This method initializes the XmlReader member. /// </summary> /// <param name="httpClientUtil">A configured <see cref="HttpClientUtil"/> instance for performing web requests</param> private void CreateReader(HttpClientUtil httpClientUtil) { var xmlReaderSettings = new XmlReaderSettings { IgnoreComments = true, IgnoreProcessingInstructions = true, IgnoreWhitespace = true, DtdProcessing = DtdProcessing.Prohibit }; XmlReader = XmlReader.Create(httpClientUtil.GetDataStream(), xmlReaderSettings); }