ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / WEBDEV specific features / SaaS
  • Overview
  • Enabling the SaaS implementation
  • Connection mode
  • Page for automatic connection
  • Page for custom connection
  • Remarks
  • Checking the authorizations
  • Remark
  • Customizing a SaaS site
  • Configuring the test mode
  • Using a WEBDEV Application Server (limited or not to 10 connections)
  • Using a local SaaS server
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Enabling the SaaS implementation
To enable the implementation of the SaaS features in the project:
  1. On the "Project" tab, in the "Project" group, click "Description".
  2. In the "Project" tab, check "SaaS site (Software as a Service)":
    SaaS options
  3. Specify (if necessary) the name of the Application Server (or the full address of the SaaS Webservice) that will be used for the test mode.
    To use the local SaaS server, no address must be specified.
    For more details, see Configuring the test mode.
  4. Specify the connection mode:
    • Check "Use the "Automatic connection" mode" to use the integrated connection mode of WEBDEV.
    • Uncheck this box if you want to customize the page for connecting to the application.
For more details, see Connection mode.
Connection mode

Page for automatic connection

When a SaaS site uses the page for automatic connection, the WEBDEV Application Server generates a page that allows the user to connect to the site.
This page takes the following operations into account:
  • Typing the login and password.
    • A link is used to manage the forgotten password. In this case, an email is sent to the user with the correspondingt security code.
      Caution: to use this feature, the email address of the user must be filled and the SaaS administrator must be configured for sending emails by SMTP.
    • After 3 attempts for typing the password, the input of a captcha is requested in addition to the password for identification.
  • Call to SaaSConnect to check the authentication information.
  • Checking whether the user owns a license for at least one service supplied by the site.
  • Automatically changing the connection of all the data files for the site analysis.
    This change is equivalent to the following code:
    HChangeConnection("*", SaaSClientConnection())
Benefits of this method:
  • If the site defines a single service, there is nothing to program.
  • Quick test for switching a site to SaaS.
  • Ability to improve the result of automatic calls by using HChangeConnection or SaaSCheckService in the site.

Page for custom connection

If the mechanism for automatic connection is not used, a mechanism must be implemented on one of the site pages to allow the authentication of the user toward the SaaS Webservice.
The connection page must:
  1. Call SaaSConnect to establish the connection to the SaaS Webservice.
  2. Check the services that can be used by the user (SaaSCheckService).
  3. Change the connection for the data files of the analysis by using HChangeConnection. The connection information of the current SaaS user can be retrieved by SaaSClientConnexion.
Benefits of this method:
  • Ability to customize the connection page.
  • The connection page is not necessarily the first page of the site. You can have a "public" section visible by everyone and a "private" section accessible to the authenticated users.

Remarks

  • Even the public section of a site may require a call to SaaSConnect (by using a "guest" identifier) in order to allow the customization of the user interface via to the parameters associated with the SaaS client account. For more details, see Customizing a SaaS site.
  • We advise you to access the connection page by using the HTTPS protocol in order to avoid having authentication information travel in clear over the network.
  • To increase the security of the SaaS site, the Webservice can be installed on a computer that is not accessible publicly but only from the WEBDEV Application Server that is hosting the SaaS site. Therefore, the requests made to the Webservice cannot be intercepted.
Checking the authorizations
You can segment the different features offered by a SaaS site by declaring services in the SaaS administrator. These services are made available to the users via a pricing. A pricing groups one or more services. The user accounts subscribe to the pricing and distribute the licenses to their users.
Call SaaSCheckService to check if the logged-in user has a license for a site functionality.
For example, you can display an error message and redirect the user. SaaSCheckService is used in the initialization code of a page as follows:
// Checks whether the user is allowed to add new incidents into the database
IF SaaSCheckService("Adding incidents") = False THEN
Error("Your subscription level does not allow you to add new incidents.")
PageDisplay(PAGE_BugList)
END
You can also hide the elements that cannot be accessed by the user:
// Hides the chart of statistics
// if the subscription of the current user does not include the "statistics" service
CHART_Stat.Visible = SaaSCheckService("statistics")

Remark

Even in sites that offer a limited number of services, it is always useful to declare constants that correspond to the names of the services, to avoid typos in the calls to SaaSCheckService.
Customizing a SaaS site
The GUI and the operating mode of a SaaS site can be customized for each client account. This customization can be done as follows:
  • Caption depending on the client account.
  • Images specific to each client account.
  • Internal operating mode (site algorithms) depending on the client account.
Most of the setting according to the client is based on the use of SaaSReadSiteParameter.
The administrator of the SaaS system can define one or more parameters for each site declared in the SaaS administrator. These parameters (identified by their names) can be read again in the code of the site via SaaSReadSiteParameter to change the site's behavior.
Some examples:
  • Configuring the logo and title of site pages
    This code can be used in a page template, found in each site page.
    // Configure the GUI of the SaaS site
    IMG_Logo = SaaSReadSiteParameter("LogoImage")
    EDT_Title = SaaSReadSiteParameter("ClientTitle")

    In this example, all you have to do is declare "LogoImage" and "ClientTitle" as being parameters of site and customize their value for each client account.
  • Configuring the algorithm of the site
    bIsAPro is boolean
    bIsAPro = SaaSReadSiteParameter("ProAccount")
     
    IF bIsAPro = True THEN
    ApplyProDiscount()
    ELSE
    ApplyRewardCardDiscount()
    END

    In this example, the "ProAccount" parameter specifies whether the client account references a professional user or a standard user and a specific process is called according to this information.
Configuring the test mode
Several configurations can be used to start a SaaS site in test mode:
  • Using a WEBDEV Application Server.
  • Using a WEBDEV Application Server for test (limited to 10 connections).
  • Using a local SaaS server.

Using a WEBDEV Application Server (limited or not to 10 connections)

To use a WEBDEV Application Server in test mode, you must specify:
  • its name (or IP address) in the corresponding field of the project description window ("Project" tab, "Project" group, "Description").
  • the full URL of the Webservice (if you want to use the HTTPS protocol for example).

Using a local SaaS server

To use a local WEBDEV Application Server in test mode, no address must be specified for the SaaS server in the project description. To start the local SaaS administrator, go to the "Tools" tab, "Web utilities" group and click "WDAdminSaaS".
Related Examples:
WW_SAASClientSite Training (WEBDEV): WW_SAASClientSite
[ + ] The "WW_SAASClientSite" example is an example for using the SAAS management functions of WEBDEV.

This example is presented like a site for selling SAAS solutions.
To use this example, a SAAS site must be configured as defined in the initialization code of the project.
The Web user can subscribe to a given pricing of a SaaS site without having the call the administrator of the SaaS server.
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help