Creating Web Applications Using WebGen
You can generate web applications in HTML/JavaScript from OpenROAD frames. This web application can be deployed on a web server such as Apache tomcat.
Using WebGen functionality, you can quickly create and deploy a web application with the same functionality as a desktop application. OpenROAD widgets are converted to HTML elements. For example, an EntryField is converted to <input> and ButtonField is converted to <button>.
You can deploy your application on a web server and use that web application in browsers such as Google Chrome, Mozilla Firefox, and Microsoft Edge. You also can debug these web applications in the browser. Although you cannot change the web application directly, you can change the OpenROAD frame and generate the web application again.
Widgets That Can Be Converted
• FreeTrim
• BoxTrim
• EntryField
• EntryField Multiline
• ButtonField
• ToggleField
• RadioField
• OptionField
• ListField
• SliderField
• SegmentShape
• RectangleShape
• EllipseShape
• ImageTrim
• TableField
Prerequisites
• You can a servlet-based HTTP server installed such as Apache Tomcat. (This is needed for JSON-RPC related testing. For GUI-related testing, any web server can be used.)
• Java JDK must be installed for war creation.
Limitations
• Any database-related statements such as SELECT, Execute Immediate, inquire_sql, and so on, will not be converted. It is assumed that all database queries are in an OpenROAD server application. OpenROAD WebGen functionality is useful for OpenROAD applications containing only GUI elements.
• The current look of generated web application is similar to OpenROAD desktop applications. We will modernize the look in the future.
• Some OpenROAD widgets such as TreeView and TabFolder are not supported yet.
• User events are not supported yet.
• Microsoft Internet Explorer browser is not supported yet.
Creating a web application from an OpenROAD application
1. Create or import your OpenROAD application with a frame.
2. Create a folder named as an OpenROAD application name <appname>.
3. Issue the following command in cmd/bash with the OpenROAD environment inside the <APPNAME> folder, substituting the name of the OpenROAD application and database name:
w4gldev compileapp <dbname> <appname> -js <appname>.js
A single JS file (the one named after the -js flag) will be created. HTML files (with the .html extension) will be created for each application frame. These HTML files will have the same name as the OpenROAD frame they were derived from.
4. Copy core.js and orfields.js into the <appname> folder.
5. Copy the <appname> folder into the CATALINA_HOME\webapps folder.
6. Alternatively, you can create single file using following command:
jar -cvf <appname>.war *
7. Copy the generated <appname>.war file into the CATALINA_HOME\webapps folder.
8. Open the web application in a web browser such as Firefox, Chrome, or Edge under localhost:<port>/<appname>/<framename>.html.
9. You can create a test for the previous URL with test utility such as Robot test framework/TestComplete.
Assumptions
• Latest OpenROAD patch
• Servlet based HTTP server such as Apache Tomcat (This is needed for JSON-RPC related testing. For GUI related testing any web server can be used)
• Java JDK for war creation
Viewing Transpilation Errors
You can view any 4GL compiler errors and warnings by specifying the -e (errors) and -w (treat warnings as errors) flags. If transpiling a module generates transpilation errors, those errors will also be viewable using the -e (errors) flag. Any errors and the 4GL source code that generated them will be written to the Trace log file.