Class SignUpConfiguration


  • public class SignUpConfiguration
    extends java.lang.Object
    Provides all the necessary settings for the SignUpAssistant Component
    See Also:
    SignUpAssistantComponent
    • Field Detail

      • errorMessages

        public final java.util.Map<SignUpErrorCodes,​java.lang.String> errorMessages
        A map of customizable error messages associated with the the SignUpAssistant default error codes. Developers can customize their messages starting from the default templates provided.

        NOTE: It is important to maintain the same exact number of place holders ( %s ) in the translated messages so that parameters are correctly inserted at runtime. Failing to do this will cause unexpected runtime exceptions.

        The CUSTOM_ERROR code can be used by pre/post process Plugins to throw custom errors.

        Error codeDefault message
        MISSING_USERNAMEUser name is required
        USERNAME_TOO_SHORTUser name is too short, min. amount of characters is %s
        USERNAME_TOO_LONGUser name is too long, max. amount of characters is %s
        USERNAME_ALREADY_IN_USEUsername: %s is already in use
        MISSING_PASSWORDPassword is required
        PASSWORD_TOO_SHORTPassword is too short, min. amount of characters is %s
        PASSWORD_TOO_LONGPassword is too long, max. amount of characters is %s
        MISSING_EMAILAn email is required
        INVALID_EMAILEmail address: %s is invalid
        EMAIL_ALREADY_IN_USEEmail address: %s is already in use
        RECOVER_NO_USERPassword recovery error, username %s was not found
        ACTIVATION_NO_IDInvalid Activation. Session doesn't contain a database ID
        ACTIVATION_INVALID_CODEInvalid Activation Code received
        GENERIC_DB_ERRORUnexpected Database Error. Please contact our support
        CUSTOM_ERROR%s
        See Also:
        SignUpErrorCodes
      • customDbManager

        public IDBManager customDbManager
        (Optional) A custom Database Manager in case you don't want to use the default Zone's DB Manager.
        See Also:
        SFSDBManager
      • signUpTable

        public java.lang.String signUpTable
        The name of the Database table used for storing the user registrations. Default = 'users'
      • idField

        public java.lang.String idField
        The name of the field used as the main table Id. The field is expected to be an auto-increment Int or Long. Default = 'id'
      • usernameField

        public java.lang.String usernameField
        The name of the field used to store the user name. Default = 'username'
      • passwordField

        public java.lang.String passwordField
        The name of the field used to store the user password. Default = 'password'
      • emailField

        public java.lang.String emailField
        The name of the field used to store the user's email. Default = 'email'
      • passwordMode

        public PasswordMode passwordMode
        Indicates how the password should be stored in the database
        See Also:
        PasswordMode
      • activationCodeField

        public java.lang.String activationCodeField
        (Optional) The name of the field used to store the auto-generate activation code. Default = null.

        By setting this field the Activation process will generate a unique activation code that will be sent via email to the User. The client will be able to activate his account by providing the secret code. Without an activation the login will be forbidden.

        See also: userIsActiveField

      • activationCodeLength

        public int activationCodeLength
        (Optional) If the activationCodeField is used this property will indicate the length of the activation hash code. Default length = 32
        Since:
        SFS2X 2.13
      • userIsActiveField

        public java.lang.String userIsActiveField
        (Optional) If the activationCodeField is used this property will indicate which field to use to keep track of the User's account activation. The required database field must be of string type and will contain a Y or N character to indicate the state of the activation.
      • extraFields

        public java.util.List<java.lang.String> extraFields
        (Optional) A list of other field names to be stored in the user account. Default is null

        Supposing you specify three extra fields called "Country", "Avatar" and "Language" you will need to send those parameters from the client by using the same field names as the keys of the SFSObject sent to the Extension.

      • preProcessPlugin

        public ISignUpAssistantPlugin preProcessPlugin
        ADVANCED

        Allows developers to add and extra plugin class in the SignUp process to manipulate objects BEFORE the SignUp data is verified and stored in the database. This can be useful to add custom validations for extra fields or enforcing other signup rules.

        Default is null (no pre-processing is done)

        See Also:
        ISignUpAssistantPlugin
      • postProcessPlugin

        public ISignUpAssistantPlugin postProcessPlugin
        ADVANCED

        Allows developers to add and extra plugin class in the SignUp process to manipulate objects AFTER the SignUo data has been stored and before the client email is sent. This can be useful to add customizations to the email text or add extra parameters to the client's response object.

        Default is null (no post-processing is done)

        See Also:
        ISignUpAssistantPlugin
      • checkForDuplicateUserNames

        public boolean checkForDuplicateUserNames
        Checks that a user is not registering with an existing user name. Default = true
      • checkForDuplicateEmails

        public boolean checkForDuplicateEmails
        Checks that a user is not registering with an existing email address. Default = true
      • isEmailRequired

        public boolean isEmailRequired
        Determines whether or not an email address is mandatory for signing up. Default = true
      • minUserNameLength

        public int minUserNameLength
        Minimum length of the user name. Default = 4 characters
      • maxUserNameLength

        public int maxUserNameLength
        Maximum length of the user name. Default = 30 characters
      • minPasswordLength

        public int minPasswordLength
        Minimum length of the user password. Default = 6 characters
      • maxPasswordLength

        public int maxPasswordLength
        Maximum length of the user password. Default = 30 characters
      • maxEmailLength

        public int maxEmailLength
        Maximum length of the email field. Default = 50 characters
      • logSQL

        public boolean logSQL
        (Debug Only) logs every SQL query for testing / debugging purposes. Never leave this turned on in production. Default = false
    • Constructor Detail

      • SignUpConfiguration

        public SignUpConfiguration()