PowerServer deployment

Tutorials and PowerServer Help

It is highly recommended that you access the online help of PowerServer 2021 at https://docs.appeon.com/ps2021/. The last-minute and latest documentation changes will be reflected in the online help.

You can also access the compiled HTML Help (.chm) of PowerServer 2021 from Windows Start > Appeon PowerBuilder 2021 > PowerServer 2021 Help, or from the Help button () in the PowerServer Toolkit that displays as a PainterBar in the PowerBuilder IDE when a PowerServer project is open in the currently active painter.

Following are links to the online help of the Quick Start guide and Tutorials which can help you get started with the PowerServer deployment method:

Key features

PowerBuilder 2021 introduces a new project type: PowerServer. With the PowerServer project type, PowerBuilder applications can be deployed as installable cloud applications which have the following features:

  1. The installable cloud app can support almost all of the features of PowerBuilder.

    The installable cloud app is the cloud version of a PowerBuilder application; it is installed on the client, and can be launched directly from the desktop. But in contrast to browser-based apps, installable cloud apps are deployed with native PowerBuilder code (rather than converted to JavaScript) and run on the client's PowerBuilder virtual machine (PBVM). Minimum code changes are required for the app deployment. The PBVM is exactly the same one used by the PowerBuilder classic client/server apps.

  2. The installable cloud app runs in n-tier architecture.

    The installable cloud app makes HTTP or HTTPS calls to PowerServer and then PowerServer connects to the database and executes SQL queries. PowerServer can be installed on any Web server running Windows or Linux or docker or cloud server. PowerServer contains an API server which uses standard REST APIs with REST security to handle the HTTP/HTTPS requests from the client. PowerServer also contains a data server which uses .NET DataStore to handle the data-related requests. Currently .NET DataStore supports ASE, SQL Server, Oracle, SQL Anywhere, PostgreSQL, MySQL, HANA, and SQLite.

  3. The installable cloud app is installed over the Internet and automatically and incrementally updated.

    To install an installable cloud app on the client machine, you access the application URL in a Web browser. You only need to use the Web browser to obtain the installable cloud app for the first time. After that, you can directly run the app from the desktop. And if any updates are available, the app will be automatically and incrementally updated.

  4. The installable cloud deployment can be a full replacement for the traditional PowerServer Web solution.

    The installable cloud app can be installed on a Windows client, but not on any mobile client such as iOS or Android. The installable cloud deployment option can be used as a replacement for the traditional PowerServer Web solution. But for the PowerServer Mobile solution, the user will need to manually implement the client UI logic.

Note

You must have a PowerBuilder CloudPro license in order to use the PowerServer deployment features in the PowerBuilder IDE; and you must run PowerBuilder IDE as administrator in order to use the PowerServer deployment features.

Architecture

The installable cloud apps must be deployed against PowerServer 2021. PowerServer 2021 is a brand new PowerServer which is totally different from the traditional PowerServer. For more information, refer to this whitepaper: Deploying PowerBuilder Apps to the Cloud.


The following table introduces PowerServer 2021.

-

Web Server

Web API Server

Supported Database Types

PowerServer 2021

IIS/Apache/Nginx on a Windows/Linux machine or on Docker or cloud server.

PowerServer 2021 contains an API server which uses standard REST APIs with REST security to handle the HTTP/HTTPS requests from the client.

The host environment of the API Server can be Kestrel, IIS, Docker, or any environment that supports ASP.NET Core apps.

ASE, MySQL, Oracle, PostgreSQL, SQL Anywhere, and SQL Server


The following table introduces installable cloud apps.

Architecture

App Type

Client Type

Deployment Technology

Code Changes

Database Connection

N-tier architecture.

Installed over the Internet and updated automatically and incrementally.

The installable cloud version of a PowerBuilder application; it is installed as a desktop app on the client, and can be launched directly from the desktop.

Windows

Deployed with native PowerBuilder code and runs against the PowerBuilder virtual machine (PBVM) on the client. The PBVM is exactly the same one used by the PowerBuilder classic client/server apps.

Supports almost all of the features of PowerBuilder, therefore minimum code changes are required.

The installable cloud app does not directly connect to the database server. Instead, it communicates with the Web APIs hosted in PowerServer (on .NET Core) via HTTPS, and the Web APIs connect to the database server to perform CRUD operations on the .NET data models and ESQLs included in the PowerServer Web API project.

The .NET Core Web APIs support OAuth 2.0 or JWT authentication to prevent unauthorized access; the PowerServer and the database server shall be located in the same LAN and be placed behind the corporate firewall.

In installable cloud apps, each transaction uses a database connection, and when the transaction is completed, the database connection is ended. Such short-lived connections are more secure and less vulnerable to network condition compared to long-running connections.


PowerServer components

PowerServer 2021 is comprised of two parts:

  • PowerServer Toolkit -- Provides utilities for 1) Creating and managing PowerServer projects; 2) Analyzing and compiling the application; 3) Generating and deploying the application web files (PBD files and supporting files) to the web server; 4) Generating a PowerServer Web API solution; 5) Compiling and running the PowerServer Web APIs (in the local environment); 6) Running a PowerServer project; 6) Generating build files from existing PowerServer projects for auto-build, etc.

    PowerServer Toolkit is provided as a component in the PowerBuilder Installer and installed as a plug-in to the PowerBuilder IDE. The PowerServer Toolkit is by default installed to %AppeonInstallPath%\Common\PSToolkit\[version]\.

  • The PowerServer NuGet packages -- The runtime library for the PowerServer Web APIs that supports data processing, authorization, licensing etc. When you launch the PowerServer C# solution, the PowerServer NuGet packages will be automatically downloaded and installed from the NuGet website (https://www.nuget.org). Please make sure the computer can connect to the NuGet website (https://www.nuget.org).

For more information, refer to refer to PowerServer Help > Installation > PowerServer Components.

Installation requirements

The following only highlights the important requirements. For more details, refer to PowerServer Help > Installation > Installation Requirements.

Client PC

To run the installable cloud app, install the following OS and Web browser:

  • Windows 10 or 8.1, or Windows Server 2019, 2016, or 2012 R2

  • Google Chrome, Mozilla Firefox, or Microsoft Edge (Chromium-based)

Development PC

It is recommended that PowerBuilder IDE, PowerBuilder Runtime, PowerServer Toolkit, and PowerBuilder Compiler are the same version and build.

To

Install the following

Build and deploy the PowerServer project

  • Windows 10 or 8.1

  • PowerBuilder IDE 2021

  • PowerBuilder Runtime 2021

  • PowerServer Toolkit 2021

Build and deploy the PowerServer project using the PBAutoBuild210.exe command

  • Windows 10 or 8.1, or Windows Server 2019, 2016, or 2012 R2

  • PowerBuilder Runtime 2021

  • PowerServer Toolkit 2021

  • PowerBuilder Compiler 2021 (or PowerBuilder IDE 2021)

Compile and publish the PowerServer Web APIs

  • Windows 10 or 8.1

  • SnapDevelop 2021 or Visual Studio 2019

    The computer must be able to connect to the NuGet site (https://www.nuget.org), in order to download the packages required for compilation.


Web Server

The app files can be hosted in the following Web servers:

  • Windows IIS

  • Windows/Linux Apache

  • Windows/Linux Nginx

* Kestrel is not recommended to be used as the Web server for hosting the app files.

* Any version within the support period is supported.

PowerServer (Web API Server)

The PowerServer Web API is an ASP.NET Core 3.1 app; it can be hosted and deployed like any other ASP.NET Core app.

The following are the most popular hosting environments:

  • Windows/Linux Docker

  • Windows IIS

  • Windows/Linux Kestrel (using IIS, Apache or Nginx as reverse proxy server)

Database Server

The installable cloud apps can work with the following databases:

  • Oracle 12c, 18c, or 19c

  • PostgreSQL 11.3, 12, or 13

  • SQL Server 2016, 2017, or 2019

  • SQL Anywhere (ODBC) 16 (16.0.0.2043 or later) or 17

  • ASE (ODBC) 16.0

  • MySQL 5.6, 5.7, or 8.0

  • Informix 12.x or 14 (Beta feature) *

    * Beta means the feature has not been full tested, has known bugs, and does not receive standard technical support.

Network

Same as any other web applications, for installable cloud apps, the Web APIs must be published to a PowerServer that locates on the same LAN as the database server. If the database is not on the same network as the Web APIs, every request has to go a long way from PowerServer to the database, it is highly possible that there will be performance and security issues.

Additional supporting features

The following features have been added to PowerBuilder to include support for installable cloud apps:

  • A system function IsPowerServerApp is added to check if the current application is an installable cloud application deployed using PowerServer.

  • The SystemError event is enhanced to return errors that are specific to the installable cloud application or PowerServer license.

  • The Application object has added the following new functions in order to support OAuth 2.0 authorization server for installable cloud apps:

  • An option "Begin session by code" is added to the Application painter's Properties view.

    This option is not selected by default; which means the session is automatically created when the application starts. If this option is selected, then the session will not be automatically created; it will be created only when the BeginSession function is executed. Normally you may want to create a session using BeginSession after you have obtained the access token, so that the session can include the access token.

  • An option "During compilation, report unsupported PowerScript features for PowerServer deployment" is added to the Application painter's Properties view.

    If this option is selected, the PowerScript features that are unsupported by the PowerServer Web APIs will be detected and reported during the deployment process.

  • The Application object provides a function (GetSessionID) for getting the session ID of the current application client.

  • The PowerServer C# solution provides interfaces (LoadAll & KillByID) for getting all user sessions and killing the specified session. For more details, see Get/Kill user sessions.

  • The DBParm CacheName property is enhanced to specify the database connection cache used by the installable cloud app.

  • The DBParm CacheGroup property is added for specifying the cache group to be used by the installable cloud app.

  • The DBParm ProcedureInTransaction property is added for specifying whether to start the transaction when executing a stored procedure for the installable cloud app.

  • PowerServer 2021 supports the following database parameters: CacheGroup, CacheName, DelimitIdentifier, DisableBind (static DW retrieve), TrimSpaces, TimeStamp (Oracle), BindSPInput (Oracle, SQLServer), and ProcedureInTransaction.

Tutorials and PowerServer Help

You can access the compiled HTML Help (.chm) of PowerServer 2021 from Windows Start > Appeon PowerBuilder 2021 > PowerServer 2021 Help, or from the Help button () in the PowerServer Toolkit that displays as a PainterBar in the PowerBuilder IDE when a PowerServer project is open in the currently active painter.


You can also access the online help of PowerServer 2021 at https://docs.appeon.com/ps2021/. The last-minute and latest documentation changes will be reflected in the online help first.


Following are links to the online help of the Quick Start guide and Tutorials which can help you get started with the PowerServer deployment method: