How to Run an OpenEdge Application Inside the Web Browser

How to Run an OpenEdge Application Inside the Web Browser

Client-server applications are expensive and tough to maintain. Working on an entirely new web application alternative becomes unfeasible if your time is limited or your resources are scarce. 

Save time and money by webifying your application with Thinfinity VirtualUI in a few easy steps. This tutorial will teach you how to integrate your existing Progress OpenEdge application with Thinfinity VirtualUI, our application virtualization solution that provides instant web access for proprietary software.

Integrate extensive applications, which include several .w/.p programs, by adding one line of code to the main program. Changes applied are inherited by all the programs included in your application’s source code. This simple change enables anywhere access to your application without testing or refactoring.

Keep in mind that VirtualUI manages to achieve this by retaining the exact same behavior as the application’s source code remains unmodified; thus, you can keep running it with the Client Networking application as you are used to. 

Learn how to integrate your proprietary OpenEdge application with Thinfinity VirtualUI with the steps listed below:

 

Progress OpenEdge Applications on Thinfinity VirtualUI

NotesThis tutorial applies to OpenEdge applications versions 8,9,10,11,12, and up.

Demo Applications

To simplify the demo application to show the integration of the VirtualUI libraries with OpenEdge 4GL, we develop it on C:\OpenEdge\VirtualUI\ using Developer Studio 12.2. VirtualUI_AppBuilder and VirtualUI_dotNET projects, and test.pdf file used on apps, which can be located in that folder:


Both app demos provided show the same basic functionality:

  • Define the file dialog usage based on the two available modes: VirtualUI built-in (StdDialogs=false) or using system dialogs (StdDialogs=true).
  • Upload files from browser machine to Server. A Server directory can be used as destination; if empty, the application temp directory is used.
  • Event handling for OnUploadEnd. The rest of the VirtualUI events can be handled in the same way.
  • Download files from Server. In the demos, the user selects a file from a FileOpen dialog browsing the Server file system.
  • Preview a PDF file on the browser.

 

Using VirtualUI on OpenEdge

VirtualUI can be used on OpenEdge applications in two ways:

  1. Using a COM object.
  2. Using a .NET class library.

 

The Thinfinity VirtualUI .NET class library is a .NET wrapper that allows programmers to natively access its events and methods. Choose each integration method depending on the OpenEdge environment you are using.

 

Using a COM Object

The project VirtualUI_AppBuilder is an AppBuilder application that uses this method.

The VirtualUI library provides ActiveX classes and interfaces registered on installation. The main class is VirtualUI.

VirtualUI handle is declared in wWin.w code:

Info  DEFINE VARIABLE VirtualUI AS COM-HANDLE NO-UNDO.

 This is created and started on the StartVirtualUI function, called as follows:

Info


  FUNCTION StartVirtualUI RETURNS LOGICAL:

    /* Create VirtualUI instance:*/

    CREATE "VirtualUI.VirtualUI" VirtualUI NO-ERROR.

   

    IF NOT ERROR-STATUS:ERROR THEN DO:

        /* Start VirtualUI: if installed*/

        VirtualUI:Start(30).

           /* Enable events:*/

        VirtualUI:ENABLE-EVENTS("VirtualUI").

         RETURN TRUE.

    END.

    ELSE

        RETURN FALSE.

  END.


 Also, events are enabled. The parameter is the prefix for procedure handlers: in this case, it is “VirtualUI”, so the event handlers must be declared as “PROCEDURE VirtualUI.EVENTNAME”. The event handler for OnUploadEnd, fired when an upload is finished, is declared in the following form:

Info

 PROCEDURE VirtualUI.OnUploadEnd:

    DEFINE INPUT PARAMETER fileName AS CHARACTER.

    MESSAGE "Uploaded file:" fileName VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "UploadEnd".

  END PROCEDURE.


Using a .NET Class Library

The project VirtualUI_dotNET is a GUI for .NET application that uses VirtualUI from a class library.

The class library Cybele.Thinfinity.VirtualUI.dll, built from Cybele.Thinfinity.VirtualUI.sln, exposes the VirtualUI SDK for C# (Thinfinity.VirtualUI.cs) provided in VirtualUI Development Environment installation.

Once the class library is added to the project, all classes and interfaces are on Cybele.Thinfinity namespace can be used on applications.

 

VirtualUI object is declared in the main form (Form1.cls):  

InfoDEFINE PRIVATE VARIABLE m_VirtualUI AS CLASS Cybele.Thinfinity.VirtualUI NO-UNDO.

 And created and started on StartVirtualUI() method, which is called from the form constructor:

Info

  METHOD PRIVATE VOID StartVirtualUI():

      /* Create VirtualUI instance:*/

      m_VirtualUI = NEW Cybele.Thinfinity.VirtualUI().

            /* Start VirtualUI:*/

      m_VirtualUI:Start(30).

      

      /* Attach event handlers:*/

      m_VirtualUI:OnUploadEnd:Subscribe(THIS-OBJECT:VirtualUI_UploadEnd).

  END METHOD.


Also, the event handler for OnUploadEnd is attached. This is fired when an upload is finished.

 

Info

  METHOD PRIVATE VOID VirtualUI_UploadEnd(INPUT sender AS System.Object, INPUT e AS Cybele.Thinfinity.UploadEndArgs ):

      MESSAGE "Uploaded file:" e:Filename VIEW-AS ALERT-BOX INFORMATION BUTTONS OK TITLE "UploadEnd".

  END METHOD.


Running on Server

To run the demos on VirtualUI Server, create the application profiles with the following parameters (check paths):

  1. VirtualUI_dotNET app:
  • Program path: C:\Progress\OpenEdge\bin\prowin.exe
  • Arguments: -p wWin.r -nosplash
  • Start in folder: C:\OpenEdge\VirtualUI\VirtualUI_dotNET

 

  1. VirtualUI_AppBuilder app:
  • Program path: C:\Progress\OpenEdge\bin\prowin.exe
  • Arguments: -p RunForm1.r -nosplash
  • Start in folder: C:\OpenEdge\VirtualUI\VirtualUI_AppBuilder

 

On production machines, the parameter -rr must be added to the arguments. If you have developer licenses, this parameter is not supported, and the Procedure Editor is shown after the main application form closes (see https://knowledgebase.progress.com/articles/Article/P20788 for more information).

 

Running on Dev Mode

To run in dev mode, under Progress Developer Studio:

1. Start VirtualUI Development Server.

2. Access http://127.0.0.1:6080 on the web browser.

3. Uncomment the lines included in the demos source files:

/* To run in dev mode, under Progress Developer Studio, uncomment these lines:*//*VirtualUI:Enabled = TRUE.

  VirtualUI:DevMode = TRUE.

  VirtualUI:DevServer:Enabled = TRUE.*/

4. Run application from Progress Developer Studio. The application will run on a desktop and on a web browser.


    • Related Articles

    • How to Run a .NET Application in a Web Browser

      Overview Note Pre-requisites: To proceed with this tutorial, you may need to register a trial license for the VirtualUI Development Server, Learn how to do it in this article. Now you are ready to get started. Let’s take your program to the cloud! ...
    • How to Run a WinForms Application Inside the Web Browser

      Do you have a WinForms (C#) application that you wish to publish on the web? Thinfinity® VirtualUI allows you to convert WinForms to web application by adding a small line of code to your C# application so it can then be accessed from any OS and ...
    • Run VB.Net Software as a Web Application

      In this new article, we will show you how to adapt your Visual FoxPro code so you can run VB.Net developments in the cloud with Thinfinity VirtualUI. App example: https://www.cybelesoft.com/support/files/DemosVUI/VBNet.zip Bear in mind in this ...
    • How to Publish an Application in Thinfinity VirtualUI Server

      Product: Thinfinity VirtualUI Version: 3 and above Introduction This step-by-step tutorial will guide you through the process of virtualizing your applications and making them accessible from any web browser using Thinfinity VirtualUI. Get ready to ...
    • How to Run a Python Development as Web App

      Have a Python application and want to run it on the web? Thinfinity® VirtualUI is a windows software virtualization solution. By adding a piece of code to your Python app source you can then run it within a web browser and access it from any OS. Run ...