RAD Server single site deployment license included in RAD Studio 10.2.2 Tokyo Edition and FireMonkey Quick Edit IDE Support

Posted by on in Blogs

RAD Studio 10.2.2 includes a RAD Server single site deployment license in Enterprise and Architect editions and adds new FireMonkey Quick Edit support, plus many additional features and benefits as described in What's New in RAD Studio 10.2.2.

FMX_QEdit_Align_-_Copy          RAD_Server_Zoom_-_Copy

Let's take a look at how we can use the new FireMonkey Quick Edit support to add a Login Form to use with the RAD Server single site deployment license.

Our developer benefit from using the new FireMonkey Quick Edit support is improved developer productivity. With the new Quick Edit feature, you can perform common actions in the FMX Forms Designer.  This functionality matches the VCL Quick Edit feature introduced in Berlin Anniversary Update, which was also enhanced in the 10.2.2 release!

Example:

File | New | Multi-Device Application – Delphi | Tabbed:

FMX_Tabbled

The wizard creates a default Multi-Device application that looks like this:

DefaultTabbed

 

Using Object Inspector,change ToolBarLabel = Inventory Control System and change the Text for TabItem1 = Login:

Inventory_Login

In the Structure pane, Right-Click on the TabItem1, and select the new Quick Edit, and change the Name = tabItemLogin

 tabitemLogin_1

Click the check mark to save the changes.

Next, on the tabItemLogin Tab, add two labels and two Edit boxes and a Button to be used to enter the Username and Password to authenticate (login) to the RAD Server:

Login

Right-Click on label1, select Quick Edit and change the Name = labelUserName and Text = Username.

labelUsername

Click the check mark to save the changes.

Do the same for label2, and change the Name = labelPassword and Text = Password.

labelPassword

Click the check mark to save the changes.

Next, Right-click Edit1, select Quick Edit, and change Name = EditUsername:

editUsername

Click the check mark to save the change.

Do the same for Edit2, Right-click Edit2, select Quick Edit, and change Name = editPassword.

editPassword

Click the checkmark to save the change.

Since this Edit field is a password, use the Object Inspector, and set the Password property = True:

PasswordTrue

 Next, Right-click the Button, select Quick Edit, change Name = buttonLogin, and Text = Login:

buttonLogIn

Click the checkmark to save changes.

 Our Login tab now looks like this:

LoginScreen

On the Login tab, add an EMSProvider component.  The EMSProvider sets up the connection to the EMS Server.  In an EMS Client application, we use the TEMSProvider to set the connection parameters (URLHost and URLPort) with the EMS Server, like this:

 EMSProvider

For the EMSProvider, us the Object Inspector and set the URLHost and URLPort of your RAD Server EMS Server:

EMS_URLHost_1

Next, on the same Login tab, add a TBackEndAuth component.  The TBackendAuth has Login and LoggedIn methods we can use to authenticate the Username and Password to the RAD Server.

For the TBackEndAuth component, use the Object Inspector and set the BackEndAuth1.Provider = EMSProvider1.

Next, let's use Visual Live Bindings to help implement the Login.  Right-click on the Login Tab, select Bind Visually... and you will see the BackendAuth, editUsername and editPassword components in the LiveBindings Designer.  Bind the BackendAuth1.UserName to the editUsername.Text and bind the BackendAuth1.Password to the editPassword.Text.  Like this in the LiveBindings Designer:

BackendLogin

Next we can implement the buttonLoginClick event like this:

procedure TTabbedForm.buttonLoginClick(Sender: TObject);

begin

        try

        BackendAuth1.Login;

        If (BackendAuth1.LoggedIn) then

        begin

        TabControl1.ActiveTab := TabItem2;

        end;

        Except

        on E: Exception do

        begin

          ShowMessage('Invalid UserName/Password or Connection to RAD Server failed');

        end;

      end;

end;

We can now test Logging into our RAD SERVER EMS SERVER.

Start you EMSDEVSERVER.EXE.

Run your client TabbedApplication.

On the Login Tab, enter one of your RAD SERVER EMS Server valid Username and Password:

LoginForm_1

Click the Login button.  If the Login succeeds, the app should advance to TabItem2, like this:

Tab2

If the Login fails, then you should see this:
InvalidUser

Congratulations!   And that's how easy it is to add Login Authentication to the RAD Server EMS Server!

And now that the current Delphi 10.2.2, C++ Builder 10.2.2 and/or RAD Studio 10.2.2 includes a RAD Server single site deployment license in Enterprise and Architect editions, you can try yourself to create awesome n-tier architecture or multi-tier architecture applications where your software is engineered to have the processing, data management, and presentation functions physically and logically separated!

 



About
Gold User, Rank: 90, Points: 4
Al Mannarino has 25+ years of software development experience, including object-oriented analysis and design (OOAD) and developing and deploying production applications. He is currently a Principal Software Consultant and Evangelist for Embarcadero Technologies. Prior to joining Embarcadero, Al spent three years working with CodeGear, a division of Borland that was acquired by Embarcadero in 2008. He also worked for five years as a lead systems engineer for Borland supporting application lifecycle management, software delivery optimization and developer tools solutions. Prior to Borland, Al served as a systems engineer for companies including Objectivity, Versant, Red Brick Systems, Information Builders, and was an electrical engineer for Grumman Aerospace performing application implementations on complex electrical-mechanical systems. Al has a bachelor's of science degree in electrical engineering from Manhattan College.

Comments

Check out more tips and tricks in this development video: