Announcing the JSDO 4.1 - Forum - Mobile - Progress Community

Announcing the JSDO 4.1

 Forum

Announcing the JSDO 4.1

  • Progress has released version 4.1 of the JavaScript Data Object (JSDO).

    Where To Find

                 Navigate to https://github.com/CloudDataObject to access the various projects.

                 A template using the JSDO is available when creating a new AppBuilder Hybrid Project (Hybrid app)

    • Note: Progress Rollbase Mobile 4.0 can use the JSDO integration with Telerik Kendo UI, which can be used from Telerik AppBuilder (a component of Telerik Platform).
    What Has Changed
     
    Here is a summary of the new features added:
    • Aliases were added for the following methods to be more consistent with non-ABL programming languages:
    • read() for fill()
    • update() for assign()
    • create() for add()
    • Aliases were also created for the following callbacks to be more consistent with non-ABL programming languages:
      • beforeRead for beforeFill
      • afterRead for afterFill
    • Support for iOSBasicAuthTimeout
      Previously if invalid login credentials cause the server to return a 401 (Unauthorized) code, the application code never receives the response and therefore cannot alert the user to the problem.To work around a bug in Apache Cordova, the progress.data.Session login() code now sets a timeout when it makes an asynchronous request using HTTP Basic authentication from an iOS device (the timeout will be set only under those conditions). The timeout allows the session manager to provide notification. The timeout defaults to 4 seconds but can be overridden by the programmer.
    • Added the ability for the JSDO to create a SQL query for Rollbase to retrieve a subset of records. This is similar to the ABL filter introduced in 4.0.

    In addition a number of issues were also corrected:

    • Updated error messages for clearer understanding of the messages.
    • Fixed a problem in Rollbase when updating a new record that has not been saved.
    • Changed the return code of logging out from true to false when web server is not running.
    • Login using Form based authentication now works even if the preliminary response from the server is a status code 403 instead of the  expected 401.
  • Thank you for this information!

    I have added a couple of wiki pages related to this:

  • Hi Edsel,
     
    is the optimization regarding the number of count requests that we discussed here on the forum a few weeks ago included in that version?
    Regards,
    Mike
     
    Von: egarcia [mailto:bounce-egarcia@community.progress.com]
    Gesendet: Dienstag, 1. September 2015 17:58
    An: TU.Mobile@community.progress.com
    Betreff: RE: [Technical Users - Mobile] Announcing the JSDO 4.1
     
    Reply by egarcia

    Thank you for this information!

    I have added a couple of wiki pages related to this:

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Hello Mike,

    Release 4.1 of the JSDO was technically done by the time that we discussed the enhancement.

    We will look into this enhancement in a future release.

    Thanks,

    Edsel

  • Is there a Typescript definitions file for the JSDO?

  • Hi Brian,

    We do not have one. There has not been any demand for TypeScript up to now.

    It is pretty easy to define one yourself. We have one we have played with and could share it with you but it is NOT supported and will not be updated when the jsdo api changes.

    The person with this is on vacation but can share it when they are back.

    Thanks

    -Shelley

  • Hello Brian,

    Thank you for your interest on a TypeScript Declaration file for the JSDO.

    I have attached the version that we have played with to the Documents section:

    https://community.progress.com/community_groups/mobile/m/documents/2621

    I hope you find it useful.

    Enjoy,

    Edsel

  • Edsel,

    Thanks for this. I was able to get my "experiment" up and running through the JSDO, using Typescript.

    I did vote for this back in July. I hope it becomes reality. (Kendo's paid-for package comes with the Typescript definitions file for its portion, by the way.)

    Brian White

  • Is there a way to add caclulated fields (or some sort of equivalent) to the JSDO on the client-side, or do we need to denormalize the data on the server-side?

  • Hello Brian,

    I think that depending on your needs, you can do this on the server side or on the client side.

    On the server, something to keep in mind is that the temp-table definition in the Business Entity does not need to match exactly the definition of your actual table, you can add or remove fields and set the values appropriately.

    On the client side, even though we do not have a calculated field feature in the JSDO, you can use Object.defineProperty() in JavaScript to obtain the result that you need.

    Here is an example of adding a StateCountry field to the table reference for eCustomer:

           Object.defineProperty(jsdo.eCustomer, "StateCountry", {

               get: function () {

                   return this.record.data.State + ", " + this.record.data.Country;

               }

           });

    ...

    Here is an example on how you would access the property:

                   console.log(jsdo.eCustomer.Name + " " + jsdo.eCustomer.StateCountry);

    I hope this helps,

    Edsel

  • Will this also work with the Kendo UI data source and the Kendo UI grid?

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Will this also work with the Kendo UI data source and the Kendo UI grid?

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Edsel,

    Thanks. I get the idea, but how do I do that from within a Typescript object? Typescript complains right after "Object." , then there are more errors after that.

    Brian

  • For Kendo data source you can add that in schema.model... ds.schema.model.total = function () { return this.qty * this.price; } only when using in grid for instance the column is total() not simply total. no idea though if doing that on a jsdo data source will break anything :(
  • It took a little experimenting, but I finally have the property added to the JSDO, in the same place in the JSTableRef as the fields brought in from the calalog.json.

    However, when I use the field in a LIstView template, I'm getting "Uncaught ReferenceError: KLASID is not defined" .

    (KLASID was the proeprty I added.)  It is occurring at in n.ui.DataBoundWidget.extend.refresh

    Any thoughts on how to resolve this? According the the Chrome debugger the property is there, and has a getter.

    Brian White