Pre-Release Notes for Alpha Anywhere (Alpha Five Version 12)

IMPORTANT: The pre-release builds are only available to customers with a valid Alpha Anywhere subscription. If your subscription has expired you will not be able to use the pre-release build.

If your subscription is valid and you download and use the pre-release build please keep in mind that if you do not renew your subscription after it expires your eligibility to use pre-release builds will end.

 

 

 

 

 


 

Build 5976 5331 17 JUL-2019 - 07:55 AM

 

 

 

The Features and Bugs Listed Below are for the current pre-release build. These features/fixes will be included in the next official Version 12 Update. These notes are for users who are testing the pre-release update.
 

This is not an official patch, so you should not deploy this update to a production environment.

 

This pre-release build is our internal, nightly build and it is made available to you for the sole purpose of testing the new features that have been added and the bug fixes that have been made since the last official release. We are making this pre-release available to you so that you can provide us with feedback on whether the changes we are making are working correctly and have not introduced new issues.

 

If you encounter any type of bug while using this pre-release build, please send information about the bug (including full instructions on how to duplicate the issue, and a test case that we can run on our own machines) to a5v12bugs@alphasoftware.com.

 

Please do NOT post bug reports concerning the pre-release build on the message board. Alpha Software engineers do NOT routinely monitor the message board and there is a good chance that your posting will be overlooked. Also, since your posting will be referencing unreleased code, it will only serve to confuse other users.

 

This pre-release build is not intended to be used in a production environment.

 

You can download the pre-release update using these links:

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_full_patch.exe

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_full_DL.exe

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_AppServer.exe

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_AppServer_patch.exe

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_RTPLUS_patch.exe

 

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_ApplicationServerIIS.exe

https://aapatches.s3.amazonaws.com/build5976/a5v12_build5976_ApplicationServerIIS_Patch.exe

 

 

https://msgboard.alphasoftware.com/alphaforum/showthread.php?112148-New-OpenSSL-and-SSLv3-Vulnerabilities

 

 

 

Videos

UX Component Debugging Javascript Code Alpha Anywhere has an embedded version of Chrome, which means you can use the Chrome debugger to debug your client-side Javascript code.

In this video we show how you can step through client-side Javascript code in the Chrome debugger and how you can use the debugger's Console window to watch the value in different variables in your Javascirpt code.

Watch Video

Date added: 2019-06-07
Creating a REST API Using a Genie to Expose Tables in a SQL Database Alpha Anywhere has a powerful REST API feature that allows you to create REST APIs for many different tasks. A common use case for a REST API is to expose data that is stored in a SQL database. The REST API Genie makes it easy to create an API that allows data to be retrieved from a SQL database and also to be updated/inserted.

In this video we show how you can use the Genie to create a REST API that exposes data in selected tables in a SQL database.

Watch Video - part 1
Watch Video - part 2
Watch Video - part 3

Date added: 2019-06-13
UX Component - List Control Using HTML Templates in the List, ViewBox and Free-form HTML Layout Control The UX builder comes with several attractively designed HTML templates than can be used when designing List controls, ViewBox controls and Free-form HTML Layout controls. In this video we show how to use the pre-defined HTML templates to create some very attractive UX components.

Watch Video - part 1
Watch Video - part 2
Watch Video - part 3

Using HTML Templates in the ViewBox Control
Watch Video - part 4

Using HTML Templates in a Free-form HTML Container Control
Watch Video - part 5
Watch Video - part 6

Download files

Date added: 2019-06-30
     

 

 

Notice

    Windows XP - Alpha Anywhere no longer supports Windows XP

Features

Build 5976

Alpha Theme - Edit Control Animation - When you give focus to an edit control the is a pulse animation shown on the control (see image below). If you turn the pulse effect off, the animation is not shown.

 

Xbasic - xbasic_execute_javascript() Function - This function now has two additional optional parameters, (validateCode and openConsoleWindow)

Syntax

p result = xbasic_execute_javascript(c js, [l flagSandbox [, l validateCode[, l openConsoleWindow]]])

Where:

Build 5966

Xbasic - Arrays - .dump_json() Method - A new method is available for property arrays. The dump_json() method allows  you to create a JSON string from data in a property array (this method is similar to the .dump_properties() method).  You specify a pattern to define the shape of the JSON that should be generated.

 

For example, assume the following JSON object that represents the data in an Xbasic property array.

 

 

dim json as c = <<%str%
[
	{"Firstname": "John", "Lastname" : "Smith",  "Address": { "Street" : "14 Main Street", "City" : "Boston", "State" : "MA"}}, 
	{"Firstname": "Henry", "Lastname" : "Rhodes", "Address": { "Street" : "4 Circle Drive", "City" : "New York", "State" : "NY"}}, 
	{"Firstname": "Allison", "Lastname" : "Berman", "Address": { "Street" : "11 Beaver Avenue", "City" : "Los Angeles", "State" : "CA"}}
]
%str%			
			

 

This JSON can be parsed into an Xbasic property array as follows:

dim p as p = json_parse(json)

 

Assume that the following pattern  (a JSON string) to define the required shape of the JSON to be dumped out:

Notice that the pattern can specify property names (and corresponding default value) for properties that may not exist in the source property array. For example, the pattern specifies a Married property with a default value of true.

 

dim pattern as c = <<%str%
{
    "Lastname": "",
    "Married": true,
    "Address": {
        "City": ""
    }
}
%str%
 
				

The  .dump_json() method can be called on the Xbasic property array. For example:

var resultJSON = p.dump_json(pattern)
			

The resulting JSON from the method is shown below:

 
 [
    {
        "Lastname": "Smith",
        "Married": true,
        "Address": {
            "City": "Boston"
        }
    },
    {
        "Lastname": "Rhodes",
        "Married": true,
        "Address": {
            "City": "New York"
        }
    },
    {
        "Lastname": "Berman",
        "Married": true,
        "Address": {
            "City": "Los Angeles"
        },
    }
]
Build 5964

UX Component - Show/Hide Controls - Improvements have been made to the way in which controls are hidden. Now, the extra space taken by the break after a control is also hidden when the control is hidden.

 

 

Xbasic - HTML_to_PDF() Function - Page Size - You can now specify page size (height and width) and margins (top, bottom, left, right) for the HTML_to_PDF() function. The page size is defined in a JSON string inside an HTML comment in the HTML to convert to PDF. For example:


<!--PAPER:
	{
	"width": "11in",
	"height": "8.5in",
	"margin": {
		"left": "0in",
		"right": "0in",
		"top": "0in",
		"bottom": "0in"
	}
}
-->
			

 

 

Build 5961

Xbasic - a5_file_get_access_control() Function - Function allows you to get a list of file permissions for a specified file/folder. The result if return in JSON format. For example:

			
?a5_file_get_access_control("c:\dev")
= [
    {
        "group": "BUILTIN\\Administrators",
        "read": true,
        "write": true,
        "append": true,
        "delete": true
    },
    {
        "group": "NT AUTHORITY\\SYSTEM",
        "read": true,
        "write": true,
        "append": true,
        "delete": true
    },
    {
        "group": "BUILTIN\\Users",
        "read": true,
        "write": false,
        "append": false,
        "delete": false
    },
    {
        "group": "NT AUTHORITY\\Authenticated Users",
        "read": true,
        "write": true,
        "append": true,
        "delete": true
    }
]

			

UX Component - PhoneGap - Instant Update - Channel Properties - When you define a new channel for Instant Updates, you can now set properties for the channel. These properties include

For example, on your <Default> (i.e. production channel), you might be using a component called 'MyApp'. But on the test channel, you might want to use a different UX component (for example 'MyAppV2').

 

In the PhoneGap Instant Update dialog, when you create a new channel, the dialog also allows you to set properties for the channel (you can't set properties for the <Default> (i.e. production) channel.

 

 

When you click the Set Channel Properties dialog the following dialog appears:

 

UX Component - List Control - Detail View - Synchronization - beforeCRUDExecute Event - When the edits in a List with Detail View are synchronized there can be multiple CRUD statements that are executed. A new event (beforeCRUDExecuted) can be defined for a List (or, in the case of a hierarchy of Lists, for the top-most List in the hierarchy) that fires before each CRUD statement is executed.

The motivation for this new event is to handle the following scenario:

Say you have made many edits  to the List and you then execute a synchronization operation. Because there are a large number of edits, it may take a significant amount of time on the server to complete all of the CRUD operations. However, if the server does not send a response back to the client before the callback times out, the client will stop listening and when the server finally completes the work and sends a response to the client, the client will not get the response (because it has stopped listening). As a result, all of the rows in the List that were dirty will remain dirty (even though on the server, all of the CRUD operations may have been completed).

However, if you send a response to the client before each CRUD operation takes place you can ensure that the client will still be listening when the server sends its final response back to the client indicating which rows in the List should now be marked as clean.

In order to use this new event, you must turn on chunked responses. This is done by passing a parameter to the .saveListEdits() method. For example:

 

{dialog.object}.saveListEdits('LIST1',{rows: 'allRows', chunked: {allow: true} });

 

 

To define the beforeCRUDExecuted event, edit the top-most List and open the List Events dialog and then select the Detail View Events category:

 

Build 5960

UX Component Builder - Right Click Menu - Goto Container End/Goto Container Start - A new menu item on the right click menu, when right clicking on a Container control (including Tab Control, Frame, PanelCard, PanelLayout and PanelNavigator) allows you to go to that container's end (or start) control.

 

 

Build 5943

UX Component - HTML Templates - New sample HTML templates are included. These templates can be used in the List control, the ViewBox control and in the Free-form HTML Container control.

 


Watch Video - part 1
Watch Video - part 2
Watch Video - part 3

Using HTML Templates in the ViewBox Control
Watch Video - part 4

Using HTML Templates in a Free-form HTML Container Control
Watch Video - part 5
Watch Video - part 6
 

Samples of the new HTML templates are shown below:

 

 

 

 

 

UX Component - List Controls - Restoring Lists From Storage - When a List is persisted to storage, the data in the List as well as the List 'state' (i.e. client side filter, client side sorting, etc.) are also persisted.

In some cases when the List is restored from storage, a Javascript error may occur when setting the List state to the persisted state.

You can now specify that when a List is restored, the data, but not the state, should be restored by setting a flag in the List's onInitialize event:

For example:

this._restoreListState = false;

 

 

 

 

 

 

Build 5935

Xbasic - AlphaDAO - FullText Searching - Portable SQL - A new function (FullTextColumnContains()) has been added to Portable SQL to make it possible to do full text searches on columns for select databases (MySQL, MariaDB and SQL Server) where portable SQL is required.

 Syntax

FullTextColumnContains(<column>, <text>)


For most syntax handlers, the function is mapped to <column> LIKE ‘%’ + <text> + ‘%’, so it is not particularly useful.

However, for MySQL and MariaDB, the function is mapped to:

MATCH(<column>) AGAINST (<text>)


To use this function on MySQL or MariaDB, You must first create a full text index on the appropriate column.

For example:



ALTER TABLE customers ADD FULLTEXT companies_fulltext (CompanyName);

 

For more information, click here.

 

For SQL Server, the syntax is mapped to:

Contains(<column>, <text)
 

Note: You must have the SQL Server Full-Text Engine installed. For more information, click these links:

https://docs.microsoft.com/en-us/sql/relational-databases/search/full-text-search?view=sql-server-2017

https://www.techrepublic.com/blog/data-center/adding-sql-full-text-search-to-an-existing-sql-server/ 

 

 

 

UX Component - Expanding Menu Control - Selected Item Style - You can now set the style for the selected menu item.

 

-

Build 5933

UX Builder - Adding Buttons and Static Text Controls - Now, when you add a Button control the builder prompts for the button text. Similarly, when you add a Static Text control the builder prompts for the text. This is a convenience because previously a generic button label was used and you would then typically change the label in the control's Property Sheet. You can turn this new behavior off if you wish.

UX Component Builder - Performance - The UX Component builder has been substantially reworked to improve performance when editing large UX components. The following optimizations have been made:

NOTE: While we have done extensive testing on the UX Builder, because of the substantial changes to the builder, it would not be surprising if you come across bugs when you edit your components. If you do find any issue, please report them to bugs@alphasoftware.com and be sure to include the component.

 

Web Control Panel - Git Integration - Customize Push/Pull Commands - You can now customize the commands to push and pull repositories. This allows you to connect your repository to an server other than GitHub.

To define custom push/pull command click the Git Settings hyperlink on the Web Control Panel.

 

 

The, define the commands you want to use to Push and Pull your repository.

 

 

PhoneGap - cli-8.1.1 - Support has been added for the latest PhoneGap cli version.

SQL Query Builder - Formatted SQL Statements - When a SQL statement is shown in the SQL window of the SQL Query Genie, the statement is now formatted with line breaks to make the SQL easier to read.

 

UX Component - Ajax Callbacks - Chunked Responses - a5AjaxChunkedResponseWrite() - The a5AjaxChunkedResponseWrite() function now takes an optional second parameter.

The a5AjaxChunkedResponseWrite() is used inside an Xbasic function that handles an Ajax callback. This Xbasic function gets called with a parameter called 'e'. You can now pass this 'e' object into a5AjaxChunkedResponseWrite() as an optional second parameter.

Syntax

a5AjaxChunkedResponseWrite(c javascript [,p e])

 

If the Javascript that you pass to the a5AjaxChunkedResponseWrite() includes placeholders (e.g. {dialog.object}, or {dialog.componentname} ), then you must pass in e to the function in order that the placeholders may be resolved.

 

Web Control Panel - Git - Create Project from Repository - Private Repository - You can now create a new project from a private repository. You will be prompted to enter your Git username (must not include '@' ) and your password.

Web Applications - Security Framework - Summary For a Security Group - The dialog where security groups are defined now has a new option (Show pages/components authorized for selected group) that allows you to see all of the pages and components, reports, etc. in the Project that the selected Group is authorized to see.

 

When you click on the hyperlink the summary dialog is show. The top list contains all files that are allowed (because these files do not require a login). The bottom list shows all files that are only allowed to users who are logged in and are members of the specified group.

 

Build 5905

REST API - Genie - Expose Tables in a SQL Database - A new genie is available when you create a new REST API. The Genie allows you to create a REST API to expose data in a SQL database. The API will allow you to query the data in a table (returning the results in a JSON format) and to update, insert and delete records. The genie automatically creates the REST API definition and also the Xbasic class that backs the REST API. The generated code supports authentication of each endpoint using an API key.

When the REST API that is created by the Genie can be used "as is", the primary purpose of the Genie is to give you a starting point in creating a customized API of your own.

 

Watch Video - part 1
Watch Video - part 2
Watch Video - part 3

 

In order to use the new genie, set focus to the Web Services category on the Web Control Panel and then click the New button.

 

Click the Create a new definition to create a REST service button.

 

 

Click the Use Genie to Create REST Service to Expose Database Tables button.

 

 

This will open the Genie, as shown below:

 

 

  1. Specify the connection string to the database that contains the tables you want to expose.
  2. Select the tables/views you want to expose.
  3. For each selected table or view, select the operations you want to expose
  4. Specify the name for the service
  5. Finally, click the OK button to create the service - An Xbasic class and a Service definition will be generated.

For each table/view the following operations are available:

 

 

Once you click the OK button, the service is created. The genie creates a file with the name of the service and a .a5svc extension (this is the service definition), and another file called sqlcrud.<name of the service>.a5xbclass. This file contains the Xbasic class that defines the code that is executed for each of the REST end points.

 

 

After the service is created, you will be asked if you want to test the API.

 

 

If you specify that you do want to test the API, the Development Server will be started (if it is not already running) and your browser will be opened showing the test page for the service.

The page shows all of the end points in your API.

 

 

 

To test a particular end point, click the button to the left of the end point. For example, in the image below, the customers_select end point is being tested. This the end point that exposes the select operation for the customers table.

 

Since this is a POST end point, the POST body must be specified using a JSON format.

In the image shown below, the properties in the POST body have been specified:

 

 

 

 

When the click the Execute button, The Curl command used to make the API call is shown and the result of the API call is shown

 

 

 

Understanding Arguments

Arguments can be used in place of literal values in name/value pair parameters and WHERE clauses. For example, the expression below is a WHERE clause that uses arguments.

fname=:c_firstname AND dob=:d_date1

 

This expression uses two arguments (c_firstname and d_date1). Notice that in the WHERE clause the argument name are prefixed with a colon (:).

The argument values are defined in a comma delimited list of name/value pairs. For example

c_firstname=Fred,d_date=12/18/1972

 

Notice that each argument name must start with a single letter, followed by an underscore. The single letter defines the data type of the argument value.  The available types are C (character), D (date), T (date/time), L (logical), N (numeric). For example

 

How to Enable Authentication

The generated service definition and Xbasic class include methods for authenticating access to the API, but the authentication is not turned on. The authentication is done by passing in an API key when the API request is made.

If you open the service definition (see image below), you will notice that each of the methods that are exposed in the API (indicated by the green icon) has a lock icon to the right indicating that the method requires authentication.

 

 

If you click on the Define Authentication Methods button in the Service Builder you will see that named authentication methods have been define for each of the exposed methods.

For example, a named authentication method called customers_select_authenticate as been defined.

 

 

If you edit the definition of the customers_select method (by double clicking on it in the Available Methods list) you will see that authentication has been turned on and that the customers_select_authenticate method has been selected as the method that will be called to authenticate access to the end point that exposes the customers_select method.

 

 

The definition for both the customers_select method and the customers_select_authenticate method are contained in the sqlcrud.<servicename>.a5xbclass file that was generated.

The generated authentication method is shown below. Notice that the apikey is marked as an optional argument in the function definition (apikey = "").

To turn authentication on for the customers_select end point, you would change the function definition for the customers_select_authenticate method so that the apikey argument was required and you would then write your own code to determine if the function should return 200 (allowed) or 401 (not allowed), based on the value of the apikey that was supplied.

 

 

function customers_select_authenticate as n (apikey = "")
'to enable authentication
'    1) change the function prototype to make apikey required

'    (e.g. function customersupdateauthenticate as n (apikey as c ) )
'    2) write code that determines if the apikey allows this action
'    3) if allowed, return 200, if not allowed, return 401
customers_select_authenticate = 200
end function

 

 

In order to supply the APIKey at the time the API is called you would need to supply its value in the query parameters for the API end point. For example:

http://127.0.0.1:10444/LivePreview/northwind.a5svc/customers_select?apikey=12345

 

TIP: If you prefer to supply the apikey in the request header, then you would edit the Authentication Method and change the setting for Arguments to header.

 

Build 5892

Node -  A newer version of Node is now bundled with Alpha Anywhere. This version supports promises and the async/await pattern.

Chrome - A newer version of Chrome is now embedded into Alpha Anywhere. This version supports an improved debugger, including the ability to add watch variables to the console window.

Watch Video
 

Bugs

UX Component - Control Behavior Overrides - Fixed a regression.

UX Builder - List Control - Incremental Refresh - Timestamp Field - Fixed an issue with incremental refresh using a timestamp field when the List had an ORDER BY clause.

UX Builder - Fixes a cosmetic issue when you move the position of a control in the UX Builder (requires hotfix).

Web Control Panel - Fixes a crash when you have added a custom column to the Web Control Panel and that column has more than 260 characters.

Phone Gap - Instant Update - Fixed an issue where Instant Update would fail if the Web Project was on a network drive.

Application Server - Web Sockets - Under certain conditions, if Web Sockets had been turned on, the Application server would become unresponsive.

Tips

 

Reports - Text Dictionary - UTF8 Characters - The labels on Layout Reports can be translated at print-time into different languages by defining a Text Dictionary for the report. The Text Dictionary contains translated values for all of the specially tagged labels in the report definition. For example, you might have a Label on a report with this text

<a5:t>Report Header</a5:t>

 

At print-time the Text Dictionary is accessed to find a translated string for Report Header in the specified language. In certain cases when the translated string contains certain UTF-8 characters, the labels on the report will not render correctly. This is a limitation that results from the code page of the machine where the server is running.

To work around this limitation, use the HTML control instead of the Text control on your report.

 

 

For example, add an HTML control to the report then edit the HTML control to add the label text.

For example

<a5:t>Report Header</a5:t>

However, this is not sufficient to work around the problem. You must also add this meta tag to the HTML (in the HTML head section).

<meta charset="utf-8">