Data filter object

Applies to Infiniti v8.1 or later
 
The DataFilter object represents each line of the filters displayed in Design. Therefore a DataFilter is either a “Comparison”, “AnyOf”, or “AllOf” filter. This is reflected in the DataFilterType property.
 
“Comparison” DataFilters represent the standard type of filter. They have the following properties:
  • FieldName: Represents the name of the filter. In our example, the filter we’re interested in has the name ”key” as that was what was defined in the AdditionalKeyFields function (below).
  • ComparisonType: “Equals”, “Greater Than”, “Less Than” etc. In the case of a web service this is almost exclusively “Equals”.
  • FieldValue: The value for the filter that has been passed in by the form.
  • “All Of” and “Any Of” filters: These represent the collections of DataFilters that go under a “all of” or “any of” heading in Design. The most important part of one of these DataFilter objects is the SubFilters property. This is the collection of DataFilters that are contained within the “any of” and the “all of” filters.
 
To find the filter you’re interested in for the BuildSoapHeader function, you’ll have to examine the criteria object. In this example, a recursive function has been created to search the criteria object for the “key”:
 
        private string CheckCriteria(Intelledox.Model.DataFilter criteria)
        {
            if (criteria.DataFilterType == Model.ClauseType.AllOf || criteria.DataFilterType == ClauseType.AnyOf)
            {
                foreach (Intelledox.Model.DataFilter filter in criteria.SubFilters)
                {
                    string result = CheckCriteria(filter);
                    if (result != null)
                    {
                        return result;
                    }
                }
            }
            else if (criteria.DataFilterType == Model.ClauseType.Comparison)
            {
                if (criteria.FieldName == "key")
                {
                    return criteria.FieldValue;
                }
            }
            return null;
        }
 
This function can then be used in the BuildSoapHeader function:
 
        protected override string BuildSoapHeader(string connectionString, string query, Intelledox.Model.DataFilter criteria, bool windowsAuthentication)
        {
                return "" + "” + CheckCriteria(criteria) + “" + ((Intelledox.MembershipSecurity.ISamlMembershipProvider)System.Web.Security.Membership.Provider).Token + "" + "";
        }
 

Related Articles

Manipulating the Header for a web service

Keywords

repeat page variable