Quantcast
Channel: Sarina DuPont, Product Manager RAD Studio
Viewing all articles
Browse latest Browse all 132

Enterprise Mobility Services Tutorial - Working with the Sign Up Endpoint

$
0
0

Today’s #DelphiWeek blog post is about working with the EMS SignUp Endpoint. You will need to configure your EMS server before following the steps in this post.  The demo we are going to build will provide an EMS sign-up screen to sign up a new user.

Enterprise Mobility Services (EMS) is a new turnkey solution for today’s interconnected, distributed apps, offering an easy to deploy middleware server that hosts loadable custom API and data access modules. EMS is based on open and standard technologies, including REST HTTP calls and JSON data formats, and provides major SQL database drivers along with a built-in encrypted SQL datastore.

This application consists of the following components:

  • TToolbar with parented TLabel for the application title
  • TListBox with 3 items (Username/Password/Button)
  • TEdit for Username
  • TEdit for Password
  • TButton for signing up the user
  • TEMSProvider
  • TBackendAuth

EMS IDE

Use the TEMSProvider component to set up the connection to the EMS Server. Modify the following properties to set up the connection properly.

EMSComp 1

  • URLHost. The URL of the EMS Server. Use:
    • localhost if the EMS Server is running on the same machine.
    • IP Address of the remote EMS Server if it is running on a different machine.
  • URLPort. The connection port of the EMS Server.
    • Default value: 8080
  • URLProtocol. The URL protocol identifier for the request to the EMS Server.
    • Default value:http

Place a TToolbar with a TLabel onto your form. Align the toolbar to MostTop, and the label to Contents with a horizontal aligment setting of Center.

I also placed a TImage onto my form and loaded an icon to it. This further helps identify this as a sign-up screen. Put a TListBox onto your form, and align it to Top. Then set top, bottom, left and right margins so that it fits next to your user graphic. Add three items to your TListbox component. Parent an edit control to each of the first two listbox items for user input, and a button to the third one.

Listbox items

Bind each edit control to the respective BackendAuth1 property using the LiveBindings Designer (View->LiveBindings Designer).

EMS LiveBindings

Set up the following on-click event for the ‘Sign Up’ button:

Object Pascal code

procedure TEMS_SignUp.SignUpBtnClick(Sender: TObject);
begin
  BackendAuth1.Signup;
  ShowMessage('Your user account has been created');
end;

C++ code

//---------------------------------------------------------------------------
void __fastcall TForm20::Button1Click(TObject *Sender)
{
BackendAuth1->Signup();
ShowMessage("Your user account has been created");
}
//---------------------------------------------------------------------------

Deploy this application (in my case, I deployed it to Windows) to sign up a user:

UserSignup example

SignUp Success

The last step is log in to the EMS console server to see a list of all of the users, access analytics etc.

EMS Admin

For more documentation on EMS, please click here.

Special Offer!


If you upgrade from Professional Edition between 21 January 2015 and 31 March 2015, you will receive a free Enterprise Mobility Services 10-user Deployment License (a $1,000 USD value).


Viewing all articles
Browse latest Browse all 132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>