KUIB: countFnName in DataProvider1.json

Posted by Mike Fechner on 21-Sep-2016 09:06

My catalog file contains a count operation (and the Kendo DataSource definitively calls into that):

operations: [
{
    name: "count",
    path: "/count?filter={filter}",
    useBeforeImage: false,
    type: "invoke",
    verb: "put",
    params: [ ]
},

But when using this Catalog to build a Data Source in Kendo UI Builder, the resulting DataSource1.json file shows an empty countFnName:

"children": [
        {
            "type": "data-source",
            "schemaVersion": "1.0",
            "name": "CustomerBusinessEntity.eCustomer",
            "serviceName": "web-CustomerBusinessEntity",
            "resourceName": "CustomerBusinessEntity",
            "tableName": "CustomerBusinessEntity.eCustomer",
            "clientSideProcessing": true,
            "countFnName": "",
            "fields": [
                {
                    "name": "CustNum",
                    "label": "Cust Num",

Is that expected? Or a problem? On the tools side or mine?

Posted by Ricardo Perdigao on 21-Sep-2016 09:51

Re-posting my earlier answer (it showed duplicate, but when I went to delete the duplicate post it removed both):

Mike,

I might be wrong here, but:

I would start by making the DataSource ServerSideProcessing , otherwise Count won't make sense:

- Click Edit on a Table inside DataSource1 (on KUIB) and unselect ClientSideProcessing

- When you do that, it will ask you to input the name of the Operation you used to do count . Enter "Count" in there and it should work  (worked for me).

For me, to use the server-side paging and sorting, I had to make my backend supports "JFP":

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvwsv/updating-business-entities-for-access-by-telerik.html 

Hope this helps,

Ricardo Perdigao

All Replies

Posted by Mike Fechner on 21-Sep-2016 09:42
Hi Ricardo,
 
I see … so but when the Catalog provides the information about the count method already, why do I have to type it in once more in KUIB? Has that been overlooked?
 
Mike
Posted by Ricardo Perdigao on 21-Sep-2016 09:45

That's a Shelley (Product Architect) conversation :)  I was only trying to help you move forward :)

Posted by Mike Fechner on 21-Sep-2016 09:50
You did! Thanks a lot!
Posted by Ricardo Perdigao on 21-Sep-2016 09:51

Re-posting my earlier answer (it showed duplicate, but when I went to delete the duplicate post it removed both):

Mike,

I might be wrong here, but:

I would start by making the DataSource ServerSideProcessing , otherwise Count won't make sense:

- Click Edit on a Table inside DataSource1 (on KUIB) and unselect ClientSideProcessing

- When you do that, it will ask you to input the name of the Operation you used to do count . Enter "Count" in there and it should work  (worked for me).

For me, to use the server-side paging and sorting, I had to make my backend supports "JFP":

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvwsv/updating-business-entities-for-access-by-telerik.html 

Hope this helps,

Ricardo Perdigao

Posted by Shelley Chase on 21-Sep-2016 10:14

Hi Mike,

The count function can be any invoke method name from the catalog. Late in the cycle we introduced the count operation type and it looks like it did not make it to the Designer for V1.

Shelley

Posted by Anil Kumar on 21-Sep-2016 10:43

Hi Mike,

The count function in the KUIB's 'Edit Data Source' dialog gets auto-populated if the Business Entity's method possess annotation as below (operation as count):

@openapi.openedge.export(type="REST", useReturnValue="false",
        writeDataSetBeforeImage="false").
    @progress.service.resourceMapping(type="REST", operation="count",
        URI="/count?filter=~{filter~}", alias="", mediaType="application/json").

Sample catalog URI with above annotation is
http://oemobiledemo.progress.com/CustomerService/static/CustomerService2.json

Catalog file possess operation information as:
{
  "name": "count",
  "path": "\/count?filter={filter}",
  "type": "count",
  "verb": "put",
  "params": []
},

Resultant datasource json file in KUIB will have the countFnName by default as below:

"children": [
        {
            "type": "data-source",
            "schemaVersion": "1.0",
            "name": "Customer",
            "serviceName": "CustomerService",
            "resourceName": "Customer",
            "tableName": "Customer",
            "clientSideProcessing": true,
            "countFnName": "count",

However, we can also have a count operation as an INVOKE.  In this scenario, count function (and countFnName in <data source name>.json file) name is not auto-populated in the 'Edit Data Source' section in KUIB.

Hope this helps.

Thanks and Regards,

Anil Kumar.

Posted by Mike Fechner on 21-Sep-2016 14:46
Thanks Anil, looks like the type of “count” is only supported since JSDO 4.3.
 
An JSDO 4.2 is not capable of importing a catalog file with a “count” type.
 
Will need to upgrade our customized JSDO then L
Posted by Mike Fechner on 21-Sep-2016 15:27

OK, now with the JSDO 4.3 my I can use a Catalog with a count method of type count - and not invoke - also in my existing Kendo UI app.

Thanks Anil!

Posted by Edward Sullivan on 29-Sep-2016 16:03

Hi All-

Just an FYI that I am going to move this post to the dedicated Kendo UI Builder group that was recently launched.

Thanks

Ed Sullivan

This thread is closed