Understanding the JSON Filter Pattern (JFP)
- Last Updated: March 30, 2020
- 3 minute read
- OpenEdge
- Version 12.2
- Documentation
The JSON Filter Pattern is a simple JSON object
that contains the ablFilter, id, orderBy, skip, and top properties, which are
intended to be used as follows:
ablFilter— Contains the text of an ABLWHEREstring (not including theWHEREkeyword itself) on which to filter the OpenEdge database query that returns the result set, as in the following examples:"ablFilter" : "(State = 'MA') OR (State = 'GA')""ablFilter" : "Name BEGINS 'A'"
A value for this property is always specified for server filtering.
Note: Some Kendo UI widgets (the Grid for example) can send a filter to a Kendo UI DataSource withserverFiltering = true. This then causes the DataSource to use the client JSDO to send a JFP expression containingablFilterto the OpenEdge Data Object.id— Specifies a unique logical ID for data on the server, however you choose to implement it. For example, you can specify a string representing the ABLROWIDof a record in an OpenEdge database.In order for the client to set this
idproperty to a value the Business Entity can use to access data, you need to initially return an appropriate value (or multiple values) for each Read operation on the data. For example, you might return a value that identifies each row of data in the result set. For OpenEdge data, this can be anidfield in each temp-table record containing the databaseROWIDof the corresponding record in the OpenEdge database.Note: Theidproperty is not currently used by the Kendo UI, but is used, for example, by Rollbase external objects.orderBy— A comma-delimited list of the names of fields used to sort the data in the result set (ascending order by default). After any field,desccan be added (case-sensitive) to indicate that sort order is descending for that field. For example:"orderBy" : "Balance, State"— The data should be sorted ascending, first byBalance, then withinBalance, byState."orderBy" : "Balance desc"— The data should be sorted byBalancedescending."orderBy" : "Country, State desc, City"— The data should be sorted first byCountryascending, then withinCountry, byStatedescending, then withinState, byCityascending.
A value for this property is always specified for server sorting.
Note: Some Kendo UI widgets make this setting on the Kendo UI DataSource internally.skip— Specifies how many records in the result set to skip before returning (up to) a page of data in the result set. A value for this property is always specified (along withtop) for server paging. For example, if the requested page size (top) is 10 and the request is for the 5th page of data, the value of this property is set to 40.Note: The Kendo UI DataSource calculates this value for some Kendo UI widgets internally.top— Specifies how many records should be returned in a single page (that is, the page size) of the result set after usingskip. A value for this property is always specified (along withskip) for server paging. (The final page in the result set can contain a smaller number of records thantopspecifies.)Note: Some Kendo UI widgets set this value on the Kendo UI DataSource internally.