PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Enabling the SaaS implementation
  • Connection mode
  • Page for automatic connection
  • Page for custom connection
  • Notes
  • Checking the authorizations
  • Note
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Enabling the SaaS implementation
To enable the implementation of the SaaS features in the project:
  1. Select "Project .. Project description".On the "Project" pane, 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.
    Versions 16 and later
    To use the local SaaS server, no address must be specified.
    New in version 16
    To use the local SaaS server, no address must be specified.
    To use the local SaaS server, no address must be specified.
    See Configuring the test mode for more details.
  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.
See Connection mode for more details.
Connection mode

Page for automatic connection

When a SaaS site is using 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.
    • Versions 22 and later
      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.
      New in version 22
      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.
      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.
    • Versions 22 and later
      After 3 attempts for typing the password, the input of a captcha is requested in addition to the password for identification.
      New in version 22
      After 3 attempts for typing the password, the input of a captcha is requested in addition to the password for identification.
      After 3 attempts for typing the password, the input of a captcha is requested in addition to the password for identification.
  • Call 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 enhance 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.

Notes

  • 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. See Customizing a SaaS site for more details.
  • 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 have the ability to 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 subscriptions to the pricing and distribute the licenses among their users.
To check whether the connected user owns a license corresponding to a feature of the site, all you have to do is call SaaSCheckService.
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")

Note

Even in the case of a site offering a limited number of services, it is always useful to declare constants corresponding to the names of the services in order to avoid typos during 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.
Indeed, 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 name) can be re-read in the code of the site via SaaSReadSiteParameter to affect the site 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 its IP address) in the corresponding control of the description window of the project (accessible via "Project .. Project description"). its name (or its IP address) in the corresponding control of the description window of the project (on the "Project" pane, in the "Project" group, click "Description").
  • the full URL of the Webservice (if you want to use the HTTPS protocol for example).
Versions 16 and later

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.
The local SaaS administrator will be started by "Tools .. WDAdminSaaS - SaaS administrator". To start the local SaaS administrator, on the "Tools" pane, in the "Web utilities" group, click "WDAdminSaaS".
New in version 16

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.
The local SaaS administrator will be started by "Tools .. WDAdminSaaS - SaaS administrator". To start the local SaaS administrator, on the "Tools" pane, in the "Web utilities" group, click "WDAdminSaaS".

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.
The local SaaS administrator will be started by "Tools .. WDAdminSaaS - SaaS administrator". To start the local SaaS administrator, on the "Tools" pane, in the "Web utilities" group, 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 required version
  • Version 15
Comments
Click [Add] to post a comment