public class SignupPlugin extends de.deepamehta.thymeleaf.ThymeleafPlugin implements SignupPluginService, de.deepamehta.core.service.event.PostUpdateTopicListener
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_TOPIC_ACCOUNT_ENABLED |
static boolean |
DM4_ACCOUNTS_ENABLED |
static String |
DM4_HOST_URL |
static String |
MAILBOX_TYPE_URI |
Constructor and Description |
---|
SignupPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
addTemplateResolverBundle(org.osgi.framework.Bundle bundle)
IMPORTANT: If you register your own bundle as a resource for thymeleaf templates you must call
reinitTemplateEngine afterwards.
|
String |
createAPIWorkspaceMembershipRequest()
A HTTP resource to associate the requesting username with
the "Custom Membership Request" note topic and to inform the administrators by email.
|
String |
createSimpleUserAccount(String username,
String password,
String mailbox)
Creates a new user account with mailbox.
|
com.sun.jersey.api.view.Viewable |
getAccountCreationOKView(String username)
The route to the confirmation page for the account creation.
|
com.sun.jersey.api.view.Viewable |
getAccountCreationPendingView()
The route to the pending page, informing the user to wait for an
administrator to activate the account.
|
com.sun.jersey.api.view.Viewable |
getAccountDetailsView()
The route to the users account edit page.
|
com.sun.jersey.api.view.Viewable |
getConfirmationInfoView()
The route informing users to please check their mail in
the next 60mins to verify and activate their new account.
|
com.sun.jersey.api.view.Viewable |
getFailureView()
The route to the error message page.
|
com.sun.jersey.api.view.Viewable |
getLoginView()
The login resource, routing either the login or the logout dialog.
|
String |
getMailboxAvailability(String email)
A HTTP resource allowing existence check fors the given email address string.
|
com.sun.jersey.api.view.Viewable |
getPasswordResetView()
The route for the password forgotton page to initiate a reset sequence.
|
com.sun.jersey.api.view.Viewable |
getSignupFormView()
The root resource, routing either the sign-up or the logout dialog.
|
String |
getTranslationTable(String language)
Fetch all ui-labels in the language the plugins source code was compiled.
|
String |
getUsernameAvailability(String username)
A HTTP resource allowing existence checks for given username strings.
|
com.sun.jersey.api.view.Viewable |
handlePasswordResetRequest(String token)
Checks the given password-reset token for validity and return either the
password-reset dialog or the error message page.
|
com.sun.jersey.api.view.Viewable |
handleSignupRequest(String username,
String password,
String mailbox)
A HTTP resource to create a new user account.
|
com.sun.jersey.api.view.Viewable |
handleSignupRequest(String username,
String password,
String mailbox,
boolean skipConfirmation)
A HTTP resource to create a new user account.
|
void |
init() |
javax.ws.rs.core.Response |
initiatePasswordReset(String email)
A HTTP Resource to initiate a password-reset sequence.
|
boolean |
isMailboxTaken(String email) |
boolean |
isUsernameTaken(String username) |
boolean |
isValidEmailAddress(String value) |
void |
postUpdateTopic(de.deepamehta.core.Topic topic,
de.deepamehta.core.model.TopicModel tm,
de.deepamehta.core.model.TopicModel tm1) |
com.sun.jersey.api.view.Viewable |
processPasswordUpdateRequest(String token,
String password)
Updates the user password.
|
com.sun.jersey.api.view.Viewable |
processSignupRequest(String key)
The HTTP resource to confirm the email address and acutally create an account.
|
void |
reinitTemplateEngine() |
void |
removeTemplateResolverBundle(org.osgi.framework.Bundle bundle) |
void |
sendSystemMailboxNotification(String subject,
String message)
Send notification email to system administrator mailbox configured in current \"Sign-up Configuration\" topic.
|
void |
sendUserMailboxNotification(String mailbox,
String subject,
String message)
Send notification email to all mailboxes in String (many are seperated by a simple ";" and without spaces.
|
addTemplateResourceBundle, getTemplateEngine, initTemplateEngine, removeTemplateResourceBundle, serviceRequestFilter, view, viewData
public static final String MAILBOX_TYPE_URI
public static final String DM4_HOST_URL
public static final boolean DM4_ACCOUNTS_ENABLED
public static final String CONFIG_TOPIC_ACCOUNT_ENABLED
public void init()
init
in interface de.deepamehta.core.osgi.PluginContext
init
in class de.deepamehta.core.osgi.PluginActivator
public String getTranslationTable(String language)
language
- public String getUsernameAvailability(String username)
getUsernameAvailability
in interface SignupPluginService
username
- public String getMailboxAvailability(String email)
email
- public javax.ws.rs.core.Response initiatePasswordReset(String email) throws URISyntaxException
initiatePasswordReset
in interface SignupPluginService
email
- URISyntaxException
public com.sun.jersey.api.view.Viewable handlePasswordResetRequest(String token)
token
- public com.sun.jersey.api.view.Viewable processPasswordUpdateRequest(String token, String password)
token
- password
- public com.sun.jersey.api.view.Viewable handleSignupRequest(String username, String password, String mailbox, boolean skipConfirmation)
handleSignupRequest
in interface SignupPluginService
username
- String must be uniquepassword
- String must be SHA-256 encodedmailbox
- String must be uniqueskipConfirmation
- Flag if "true" skips intiating the email verification process
(useful to allow admins to create new accounts without verifying users).public com.sun.jersey.api.view.Viewable handleSignupRequest(String username, String password, String mailbox)
handleSignupRequest
in interface SignupPluginService
username
- String must be uniquepassword
- String must be SHA-256 encodedmailbox
- String must be uniquepublic com.sun.jersey.api.view.Viewable processSignupRequest(String key)
key
- String must be a valid tokenpublic String createAPIWorkspaceMembershipRequest()
createAPIWorkspaceMembershipRequest
in interface SignupPluginService
public void postUpdateTopic(de.deepamehta.core.Topic topic, de.deepamehta.core.model.TopicModel tm, de.deepamehta.core.model.TopicModel tm1)
postUpdateTopic
in interface de.deepamehta.core.service.event.PostUpdateTopicListener
public com.sun.jersey.api.view.Viewable getSignupFormView()
public com.sun.jersey.api.view.Viewable getLoginView()
public com.sun.jersey.api.view.Viewable getPasswordResetView()
public com.sun.jersey.api.view.Viewable getAccountCreationOKView(String username)
username
- public com.sun.jersey.api.view.Viewable getAccountCreationPendingView()
public com.sun.jersey.api.view.Viewable getFailureView()
public com.sun.jersey.api.view.Viewable getConfirmationInfoView()
public com.sun.jersey.api.view.Viewable getAccountDetailsView()
public void sendSystemMailboxNotification(String subject, String message)
SignupPluginService
sendSystemMailboxNotification
in interface SignupPluginService
public void sendUserMailboxNotification(String mailbox, String subject, String message)
SignupPluginService
sendUserMailboxNotification
in interface SignupPluginService
public String createSimpleUserAccount(String username, String password, String mailbox)
SignupPluginService
createSimpleUserAccount
in interface SignupPluginService
public boolean isMailboxTaken(String email)
isMailboxTaken
in interface SignupPluginService
public boolean isUsernameTaken(String username)
isUsernameTaken
in interface SignupPluginService
public boolean isValidEmailAddress(String value)
isValidEmailAddress
in interface SignupPluginService
public void reinitTemplateEngine()
reinitTemplateEngine
in interface SignupPluginService
public void addTemplateResolverBundle(org.osgi.framework.Bundle bundle)
SignupPluginService
addTemplateResolverBundle
in interface SignupPluginService
public void removeTemplateResolverBundle(org.osgi.framework.Bundle bundle)
removeTemplateResolverBundle
in interface SignupPluginService
Copyright © 2018. All Rights Reserved.