Skip to end of metadata
Go to start of metadata

Introduction

The Registration Widget provides user interface functionality to register users under an apstrata account. Once the widget is placed in a web application page, it displays a form where a user can enter his username, password, email and other personal info. The registration process happens in two steps:

  1. An email is sent to the user after he enters his credentials and personal info in order to verify the provided email address
  2. The user needs to confirm his/her registration by clicking on the URL embedded in the email message sent in step 1
For the widget to work properly, some server side scripts need to be installed and configured in the apstrata account under which users will be registered. 

Getting the code for the Apstrata SDK

ApstrataSDK code is available as open source from GitHub at https://github.com/apstrata/SDKs/tree/master/ApstrataSDK.

ApstrataSDK depends on the dojo 1.6 framework, you can download from here: http://download.dojotoolkit.org/release-1.6.1/dojo-release-1.6.1-src.zip

Installing the Apstrata SDK

  1. Unpack the dojo zip file into your web application
  2. Copy the ApstrataSDK into your web application
  3. Define where the ApstrataSDK is located by including the following code in your main web application page

Configuring the Apstrata Connection Parameters

You need to set the apstrata connection parameters in the file ApstrataSDK/apstrata/sdk/ApConfig.js to use you account authentication key and secret.

Installing the server side scripts

  1. Using the developer workbench, save each of the following scripts under your apstrata account 
    1. ApstrataSDK/apstrata/ui/widgets/server/widgets.common.js
    2. ApstrataSDK/apstrata/ui/widgets/server/widgets.Registration.registerUser.js
    3. ApstrataSDK/apstrata/ui/widgets/server/widgets.Registration.userExists.js
    4. ApstrataSDK/apstrata/ui/widgets/server/widgets.Registration.verifyAccount.js
NOTE: when saving the scripts, make sure to name the scripts as their corresponding file names but WITHOUT the ".js" extension

Configuring the server side scripts

After installing the server side scripts in your apstrata account, go to the script named "widgets.common" and configure the following parameters:

NOTE: The above configuration assumes that the required stores have already been created in the apstrata account.

Embedding the widget in your web application

  1. Make sure to reference the dojo and apstrata core scripts and css files

  2. Include the apstrata configuration file and the registration widget file

  3. Instantiate the registration widget and place it in your web application page

Example

Please refer to the file "ApstrataSDK/apstrata\ui/widgets/tests/test-Registration.html" for a complete example on how to embed the widget

  • No labels