Contents Hide
Demonstrate how to deploy and run an existing project in BrightWeb, factoring in considerations for an 'Always Connected' application.
Applications may be run in BrightWeb via the BrightServer URL which is located at the URL of it's address, followed by the path './brightserver/web' For example, the BrightWeb portal of a server running on the IP address 127.0.0.1, on port 8080 would be:
http://127.0.0.1:8080/brightserver/web/
Opening this page in a browser will direct the user to the following BrightServer Data Gateway Login page:
Users with web access may use their corresponding username and password credentials on BrightWeb's login page to load their assigned released application in a web browser. Web access is assigned via the User configuration panel of a BrightServer instance.
If logging in to web the first time, it will consume one BrightServer web license. If no licenses are available, then the user may still log on, but only perform tasks in web demo mode. For more information on web licensing, please refer to the BrightServer > Licensed Web Users chapter of this documentation.
Once the user has finished with the application, they may log out using the 'log out' command in BrightWeb's toolbar. This will return to the initial login screen for BrightWeb.
While existing, rich client applications may be deployed and run as is on the server, there are a few steps that may need to be taken to optimise the compatibility of the application for the platform.
As data is written directly to the server databases as defined in their project - there no sync rules, and no concept of a local database on the device. In order for BrightServer to be able to operate freely on databases configured on the server, the 'Server Data Source' and 'Default Data Source' properties of the database sync point to be accessed in web mode must be set to 'true'. This setting may be found in the server configuration BEP, for databases in the SyncPoints panel.
BrightWeb provides support for form aspects similar to BrightForms running on Windows and Android platforms.
Applications may be specified to run in certain aspects in order to support different screen sizes (form factors) depending on the device or browser being used. This is achieved via defining aspects with associated 'client device identifiers' for each aspect defined in the project. If the application is run on a device whose aspect is not defined, the default aspect will be used.
Typically, as web applications have more screen real estate, applications may be scaled up and optimised by using this aspect feature. One may also wish to specify native resolutions for applications for set devices, in order to minimise scrolling on screens. To do this, locate and open the 'Aspects' node in the projects tree.
For more information on BrightBuilder > Form Aspects > Defining Aspects for Web Devices
As BrightWeb functions as 'Always connected', in some situations, it may not be necessary for the web application to contain the exact functionality of an application running as 'occasionally connected'. For example, as synchronisation is not needed in web mode, any synchronise button may be hidden in the web aspect. To do this, on open, a form may specify to hide the control via an expression via the, the System.GetOS() method, determining what platform the application is running in. For example:
IF(System.GetOS() == OS_WEB)
{
// Web behaviour
}
ELSE
{
// occasionally connected mode behaviour
}
Furthermore, the device and/or browser may also be analysed via the System.GetUserAgent() method, which returns the User Agent string, which may be parsed to specify particular behaviour. For example, browsers on Apple devices do not support file uploads via the browser, and thus any string containing 'iPad' or 'iPhone' may specify branching code.
In addition to more web-friendly behaviour via expressions, the BrightXpress Mobility Suite also offers a number of BrightWeb exclusive features, to assist in the functionality of applications in BrightWeb mode. For example, listview columns may be made user-clickable, such
The web interface of an application may be refined through a number of web exclusive properties, for example, text links may be created for listview columns, rather than having double click actions - via the 'Web Action' property of columns. Listview blocking is also available, such that query recordsets may be transmitted based off listview position, rather than all records needing to be transmitted at once. These properties will not affect the application in BrightForms, and makes the application more 'web-friendly', both for the end user and for economical data transmission. For more information, please refer to the BrightWeb > Web Specific Properties chapter of the user manual.
When designing web applications, there also are a number of considerations that must be made regarding the platform, due to the nature of web connections, application state and data management. While BrightWeb supports application flow similar to rich client, occasionally connected behaviour, applications running in web mode should be assessed under several design considerations which conceptually apply to web applications as a whole. For general guidelines, please refer to BrightWeb > Designing for BrightWeb chapter of the user manual.
The application included in this tutorial runs on a Windows Mobile or Android device. It will display a list of contacts which may be selected and then edited on double click, or have new records registered via the "New Contact" button, both operations performed via the 'Edit Contact' cursor form. Once these details are modified locally, the records are synchronised to the server, and then the most up to date set of records is retrieved. This is done via the "Sync To/From" button. Verify this behaviour by opening or deploying the companion BEP, entering the server details in BrightForms, and performing the operations.
When initially deployed to BrightServer and run via BrightWeb, the resolution is as the PDA's default resolution. Therefore, in order to prepare the application for better compatibility to run as a web application, perform the following:
Adjust the initial form of the application to display in a screen space of 640x480.
Hide the unnecessary sync button in web mode via the form's 'Action - On Open' expression
Add a web action for the ID column values, having the edit form open on click rather than listview double click.
Assign the application to a user on the server, and activate the same user for Web access.
Reconfigure the server to have the BrightTutorial database as a data source, and set it as a default data source.
Deploy and access the application the application via the BrightWeb portal, entering the user's details and logging in. After making the changes detailed above, observe the larger screen size, web actions and direct operations on the server database.