The app has to be an executable, so electron looks perfect.
It is a disconnected app that has no database and needs to be installed all over the globe as just an executable and some support files.
All of the data is coming from already existing web services. So I am decoding json data with getUrl and json_decode.
I will try a temp table/cursor on init
until we get disconnected data (it’s in the roadmap, currently for 4.1), that will not work. The cursor never exists on the mobile client: JSON record(s) are sent from the server, and updates are sent back by JSON.
In a canvas section, there are input textbox, combobox and checkbox. These input items table fields (character/numeric/logical) have data source bind to them.
When I use getJson() to pass all the item values to backend.prg, all the data types decode from the Json parameter seems to be character or logical .f. if nothing enter into the textbox.
Is this the correct behaviour?
JSON format is text only
Logical .f. is not correct JSON format and you should provide some value if nothing is entered in textbox.
I would also recommend that you use the base64_encode() function to encode the JSON if you are passing it as parameter. In your server side proc you would then use use base64_decode() to decode it.
This prevents any issues with special characters being transferred.
Lianja Cloud Server supports OData-compatible data access.
The Server handles ODBC connections as well as HTTP requests using OData URIs. In the following article I will show you how to use Lianja Cloud Server with OData URIs that will allow you to perform CRUD (Create, Read, Update and Delete) operations on your data.
Making OData requests from jQuery and/or the Lianja HTML5 Client in a Web App is extremely straightforward and simple.
Unlike other OData implementations, Lianja Cloud Server OData services does not require any server-side configuration of web services.
You can use Lianja cloud server odata calls to perform CRUD operations on virtual tables too so this functionality is not limited to native Lianja data; MSSQL, MySQL, PostgreSQL, Oracle and others are all supported.
Let me just emphasize again. Unlike other OData implementations, Lianja Cloud Server OData services does not require any server-side configuration of web services.
Using OData to query MSSQL is working fine for me.
The example shows how to use it with Lianja SQL Server.
wwwroot should be set to C:\lianja\cloudserver\tenants\public\wwwroot\
Remember also that you have the
functions that can be used in both programs and rsp pages. These functions provide an OData abstraction above the target database SQL syntax. e.g. you can fetch MSSQL data using $limit (see below).
$format=img, if you select an image field from a table then it will be output as an IMG tag with embedded data encoding so that you can insert this into the DOM to fetch and display an image.
By specifying memo fields you can also perform CRUD operations on JSON data.
Is it also possible to use the Lianja oData interface to call a server side function which then returns JSON data?
to allow our non-Lianja clients access to our server side functions.
by including and utilising the LianjaCloudDataServceis.js in our non-lianja clients
Yes. You have several choices.
1. OData calls
3. Retrieve results of a dynamic .rsp page located in the server.
You can also write full rsp pages that return json results fast super fast.
If I have a stored procedure named sp_testfunction.prg in my SouthWind database, which returns the customers table in json format, how would I call the function using OData?
Normally you would use Lianja.evaluate() from an open app, but to evaluate code from the OData URI with no app open you need to create an app that will be used to contain all of your stored procs for fetching JSON encoded data and execute like this.
In order to call server side stored procedures in a database I have now recognized databasename! when using $eval in the 3.3 final release (next build):
// sp_fetchcustomer.prg stored procedure in southwind database // // usage: // // http://localhost:8001/odata?$eval=southwind!sp_fetchcustomer() // or // http://localhost:8001/odata?$eval=sp_fetchcustomer()&$database=southwind // parameter p_custid if parameters() = 0 // fetch all customer records select * from southwind!customers into cursor mycur else // fetch a specfic customer record select * from southwind!customers where customerid = "&p_custid" into cursor mycur endif copy to arrayofobjects myobj // return JSON encoded data to the client return json_encode(myobj)
Remember that you can test all your stored procs in the “Console” workspace:
If your data handling procs are in a library you can also make calls like this:
I created myLibrary.prg containing your fetchCustomer procedure.
When I run odata_read(“/odata?$eval=mylibrary::fetchcustomer(‘ALFKI’)”) from console it works as expected.
However, if I send