Use Delphi + Intraweb to create a standalone HTML5 application (cache manifest) using browser storage (webSQL / IndexedDB)?

My current Intraweb application is actually a DataSnap client that connects to my DataSnap server, which connects and resides with the Interbase server on the same computer. It works correctly, but rather slowly and requires a constant Internet connection to work. Each pressed button or any triggered event will require the browser to connect to the web server (within the network).

I am considering creating a standalone web application using Intraweb in the Delphi XE2, HTML5 cache discovery function and use a browser-based SQL repository (e.g. webSQL or IndexedDB) as the local repository of the browser when the mobile device goes offline. It will only connect to the actual DataSnap server if an Internet connection is available to initialize or synchronize with the DataSnap server.

Is it possible to?

My main problem is getting the URL of the web pages from the web application inside the web site, and I do not want to put all the storage code in the template files.

It is also quite difficult to move the JavaScript code generated by Intraweb to other js files, and thus I can violate the codes and logic of Intraweb applications. Is there any way around this?

+4
source share
1 answer

As you yourself stated: "Each button is clicked or any triggered event will require the browser to connect to the web server."

This is an IntraWeb project: a Client-Server application in which most of the code logic runs on the server side. You can add some AJAX widgets to your applications, but IntraWeb itself is a server-side platform.

To have a complete HTML5 AJAX client application that works autonomously, you'll need a clean JavaScript application. Even Sacha / ExtJS-based AJAX basics (like ExtPascal or UniGUI ) or Morfik require a server to start.

But creating a clean HTML5 JavaScript application is a difficult task, but it is possible because you can use the DataSnap content from JavaScript (using XML or JSON). You can try http://www.appcelerator.com/ , which is an excellent development environment and platform for creating JavaScript applications that run as native applications.

To have a disabled HTML5 application, you may need to release the following products:

Thanks to these two projects, you can code in a pascal object, then JavaScript will be compiled from the pascal source, and then use local HTML storage. See, for example, in this article about using storage with Smart / OP4JS - I tested it (in Alpha) and it works very well: you have a clean stand-alone HTML file that can work without any server and have local storage. SQLite3 planning is planned (not yet completed).

+4
source

Source: https://habr.com/ru/post/1390575/


All Articles