Hi Prabath,

Having two similar params confuses me also. However the JDataTable spec
says that "recordsTotal" is total records before filtering and
"recordsFiltered" is total records after applying the filter. However we
have added that parameter because of the JDatatable expect that parameter.

Could you please mention whats' wrong with the API here? Is it having
"/paginate" ? If so I think we can get rid of it now if our front-end is
only using paginated API for fetching the operation list of a device. AFAIR
there was one place where the front-end is not capable of handling
paginated responses. Because of that I have created a separate context for
the paginated API so that it does not break the functionality. So if thats'
the case +1 for adding a JIRA for this.

Thanks,

Harshan Liyanage
Software Engineer
Mobile: *+94724423048*
Email: [email protected]
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com <http://wso2.com/>*
lean.enterprise.middleware.

On Thu, Mar 31, 2016 at 2:20 PM, Prabath Abeysekera <[email protected]>
wrote:

> Hi Harshan,
>
> What does it mean to have an attribute named "recordsTotal" in the context
> of using some search criteria? Shouldn't both "recordsTotal" and
> "recordsFiltered" overlap?
>
> In addition, the resource URL used above does not seem to be compatible
> with REST-recommended standards. We'd have to create a JIRA and fix that as
> well.
>
> Cheers,
> Prabath
>
> On Fri, Apr 1, 2016 at 12:21 AM, Harshan Liyanage <[email protected]>
> wrote:
>
>> Hi Shavindri,
>>
>> "recordsTotal" field corresponds to the total matching records (before
>> filtering) in the database whereas the "recordsFiltered" corresponds to the
>> no of filtered records (after filtering). Ideally "recordsFiltered"
>> value will be different from the "recordsTotal" value if you pass a
>> filtering criteria (i.e. devices with username like "sha&"). But still we
>> have not added that support. Hence the both values will be same. But we had
>> to include the both params since the spec of JDataTable requires them both.
>> Please refer to the following doc [1] for more information.
>>
>> [1]. https://datatables.net/manual/server-side#Returned-data
>>
>> Thanks,
>>
>> Harshan Liyanage
>> Software Engineer
>> Mobile: *+94724423048*
>> Email: [email protected]
>> Blog : http://harshanliyanage.blogspot.com/
>> *WSO2, Inc. :** wso2.com <http://wso2.com/>*
>> lean.enterprise.middleware.
>>
>> On Thu, Mar 31, 2016 at 2:04 AM, Shavindri Dissanayake <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> When you run the REST API command to get the paginated details (example
>>> [1]), the output given [2] has the *recordsFiltered* and *draw* fields.
>>> What do they stand for?
>>> *(recordsFiltered* seems to give the same information as *recordsTotal)*
>>>
>>>
>>> [1] curl -X GET -H "Content-Type: application/json" -H "Authorization:
>>> Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https:
>>> //localhost:9443/mdm-admin/paginate/operations/ios/f409r4c55924rt4af9a44tts15y9d6cd56h1047d
>>>
>>> [2]
>>> > GET
>>> /mdm-admin/operations/paginate/ios/f409r4c55924rt4af9a44tts15y9d6cd56h1047d
>>> HTTP/1.1
>>> > Host: localhost:9443
>>> > User-Agent: curl/7.43.0
>>> > Accept: */*
>>> > Content-Type: application/json
>>> > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a
>>> < HTTP/1.1 200 OK
>>> < Cache-Control: private
>>> < Expires: Thu, 01 Jan 1970 05:30:00 IST
>>> < Date: Tue, 23 Feb 2016 05:23:56 GMT
>>> < Content-Type: application/json
>>> < Content-Length: 3785
>>> < Server: WSO2 Carbon Server
>>> {"recordsTotal":6,"recordsFiltered":6,"draw":0,"data":[
>>> {"code":"DEVICE_INFO","type":"COMMAND","id":38,"status":"PENDING",
>>> "receivedTimeStamp":"","createdTimeStamp":"2016-02-23 10:51:22.06",
>>> "isEnabled":false},{"code":"APPLICATION_LIST","type":"COMMAND","id":37,
>>> "status":"PENDING","receivedTimeStamp":"","createdTimeStamp":"2016-02-23
>>> 10:51:20.755","isEnabled":false}]}
>>>
>>> [3] JSON output.
>>> { "recordsTotal": 6, "recordsFiltered": 6, "draw": 0, "data": [ {
>>> "code": "DEVICE_INFO", "type": "COMMAND", "id": 38, "status": "PENDING",
>>> "receivedTimeStamp": "", "createdTimeStamp": "2016-02-23 10:51:22.06",
>>> "isEnabled": false } ] }
>>>
>>>
>>>
>>> Thanks & Regards
>>> Shavindri Dissanayake
>>> Technical Writer
>>>
>>> WSO2 Inc.
>>> lean.enterprise.middleware
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Prabath Abeysekara
> Technical Lead
> WSO2 Inc.
> Email: [email protected]
> Mobile: +94774171471
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to