public class SignUpAssistantComponent extends BaseClientRequestHandler
The component offers many features out of the box.
The only two mandatory fields are the user's name and password, the others (email, activation) can be configured and any number of custom fields can also be added and validated via custom plugin.
public class SignUpTestExtension extends SFSExtension
{
private SignUpAssistantComponent suac;
public void init()
{
suac = new SignUpAssistantComponent();
suac.getConfig().signUpTable = "signup_test";
suac.getConfig().extraFields = Arrays.asList("country", "age", "zone");
suac.getConfig().emailResponse.isActive = true;
suac.getConfig().emailResponse.fromAddress = "info@mywebsite.com";
suac.getConfig().emailResponse.subject = "Thanks for signing up";
suac.getConfig().emailResponse.template = "SignUpEmailTemplates/SignUpConfirmation.html";
addRequestHandler(SignUpAssistantComponent.COMMAND_PREFIX, suac);
}
public void destroy()
{
super.destroy();
}
}
NOTE:
You can learn more about these components by reading the tutorials here.SignUpConfiguration| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMMAND_PREFIX |
| Constructor and Description |
|---|
SignUpAssistantComponent() |
| Modifier and Type | Method and Description |
|---|---|
SignUpConfiguration |
getConfig() |
IDBManager |
getDbManager() |
void |
handleClientRequest(User sender,
ISFSObject params)
Handle a client request
|
getApi, getLogger, getParentExtension, send, send, send, send, setParentExtension, trace, tracepublic static final java.lang.String COMMAND_PREFIX
public SignUpConfiguration getConfig()
public void handleClientRequest(User sender, ISFSObject params)
IClientRequestHandlersender - the sender of the requestparams - the parameters of the requestSFSObjectpublic IDBManager getDbManager()