public class UserInvitationComponent extends DefaultComponent implements UserInvitationService
Modifier and Type | Class and Description |
---|---|
protected class |
UserInvitationComponent.RegistrationAcceptator |
protected class |
UserInvitationComponent.RegistrationApprover |
protected class |
UserInvitationComponent.RegistrationCreator |
protected class |
UserInvitationComponent.RegistrationRejector |
protected class |
UserInvitationComponent.RequestIdValidator |
protected class |
UserInvitationComponent.RootDocumentGetter |
protected class |
UserInvitationComponent.UserRegistrationModelCreator |
UserInvitationService.ValidationMethod
Modifier and Type | Field and Description |
---|---|
protected Map<String,UserRegistrationConfiguration> |
configurations |
protected static org.apache.commons.logging.Log |
log |
static String |
NUXEO_URL_KEY |
protected String |
repoName |
protected RenderingHelper |
rh |
protected String |
testRendering |
lastModified
REGISTRATION_CONFIGURATION_NAME, REGISTRATION_DATA_DOC, REGISTRATION_DATA_USER
Constructor and Description |
---|
UserInvitationComponent() |
Modifier and Type | Method and Description |
---|---|
void |
acceptRegistrationRequest(String requestId,
Map<String,Serializable> additionnalInfo)
accept the registration request
|
protected String |
buildEnterPasswordUrl(UserRegistrationConfiguration configuration) |
void |
checkRequestId(String requestId)
The method checks if the request id is a valid one.
|
protected boolean |
checkUserFromRegistrationExistence(DocumentModel registrationDoc) |
NuxeoPrincipal |
createUser(CoreSession session,
DocumentModel registrationDoc) |
void |
deleteRegistrationRequests(CoreSession session,
List<DocumentModel> registrationDocs)
Delete a registration document
|
protected void |
generateMail(String destination,
String copy,
String title,
String content) |
UserRegistrationConfiguration |
getConfiguration() |
UserRegistrationConfiguration |
getConfiguration(DocumentModel requestDoc) |
UserRegistrationConfiguration |
getConfiguration(String name)
Return specific configuration for the specified name
|
Set<String> |
getConfigurationsName()
List all registered onfiguration name
|
protected String |
getJavaMailJndiName() |
String |
getNameEventRegistrationAccepted() |
String |
getNameEventRegistrationRejected() |
String |
getNameEventRegistrationSubmitted() |
String |
getNameEventRegistrationValidated() |
DocumentModel |
getOrCreateRootDocument(CoreSession session,
String configurationName) |
RegistrationRules |
getRegistrationRules(String configurationName)
Get registration rules adapter
|
DocumentModel |
getRegistrationRulesDocument(CoreSession session,
String configurationName)
Get documentmodel that stores request configuration using RegistrationConfiguration facet.
|
DocumentModelList |
getRegistrationsForUser(String docId,
String username,
String configurationName)
Retrieve registrations for a document givent the username
|
protected InvitationUserFactory |
getRegistrationUserFactory(UserRegistrationConfiguration configuration) |
protected String |
getTargetRepositoryName() |
String |
getTestedRendering() |
DocumentModel |
getUserRegistrationModel(String configurationName)
Create a document model for the UserRegistration doctype.
|
protected static boolean |
isEmailExist(UserRegistrationConfiguration configuration,
DocumentModel userRegistration) |
protected static boolean |
isTestModeSet() |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
rejectRegistrationRequest(String requestId,
Map<String,Serializable> additionnalInfo)
reject the registration request
|
protected void |
reviveRegistrationRequest(CoreSession session,
DocumentModel registrationDoc,
Map<String,Serializable> additionalInfos) |
void |
reviveRegistrationRequests(CoreSession session,
List<DocumentModel> registrationDocs)
Send a mail to the invited user to revive his invitation If an error occured while sending an email, it logs it
and continue.
|
protected void |
sendEmail(Map<String,Serializable> additionnalInfo,
DocumentModel registrationDoc,
String emailTemplatePath,
String emailTitle) |
protected EventContext |
sendEvent(CoreSession session,
DocumentModel source,
String evName) |
protected void |
sendValidationEmail(Map<String,Serializable> additionnalInfo,
DocumentModel registrationDoc) |
String |
submitRegistrationRequest(DocumentModel userRegistrationModel,
Map<String,Serializable> additionnalInfo,
UserInvitationService.ValidationMethod validationMethod,
boolean autoAccept)
Stores a registration request and return a unique ID for it
|
String |
submitRegistrationRequest(String configurationName,
DocumentModel userRegistrationModel,
Map<String,Serializable> additionnalInfo,
UserInvitationService.ValidationMethod validationMethod,
boolean autoAccept)
Stores a resgitration request like submitRegistrationRequest with Document information
|
protected boolean |
userAlreadyExists(UserRegistrationInfo userRegistrationInfo) |
Map<String,Serializable> |
validateRegistration(String requestId,
Map<String,Serializable> additionnalInfo)
Validate a registration request and generate the target User
|
Map<String,Serializable> |
validateRegistrationAndSendEmail(String requestId,
Map<String,Serializable> additionnalInfo)
Validate a registration request and generate the target User
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtension
protected static org.apache.commons.logging.Log log
public static final String NUXEO_URL_KEY
protected String testRendering
protected RenderingHelper rh
protected Map<String,UserRegistrationConfiguration> configurations
public UserInvitationComponent()
public String getTestedRendering()
protected String getTargetRepositoryName()
protected boolean userAlreadyExists(UserRegistrationInfo userRegistrationInfo)
protected String getJavaMailJndiName()
public DocumentModel getUserRegistrationModel(String configurationName)
UserInvitationService
getUserRegistrationModel
in interface UserInvitationService
configurationName
- The name of the configuration.public DocumentModel getRegistrationRulesDocument(CoreSession session, String configurationName)
UserInvitationService
getRegistrationRulesDocument
in interface UserInvitationService
public DocumentModel getOrCreateRootDocument(CoreSession session, String configurationName)
protected EventContext sendEvent(CoreSession session, DocumentModel source, String evName) throws UserRegistrationException
UserRegistrationException
protected void sendValidationEmail(Map<String,Serializable> additionnalInfo, DocumentModel registrationDoc)
protected void sendEmail(Map<String,Serializable> additionnalInfo, DocumentModel registrationDoc, String emailTemplatePath, String emailTitle)
protected static boolean isTestModeSet()
protected boolean checkUserFromRegistrationExistence(DocumentModel registrationDoc)
protected void generateMail(String destination, String copy, String title, String content) throws NamingException, javax.mail.MessagingException
NamingException
javax.mail.MessagingException
public String submitRegistrationRequest(DocumentModel userRegistrationModel, Map<String,Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept)
UserInvitationService
submitRegistrationRequest
in interface UserInvitationService
public DocumentModelList getRegistrationsForUser(String docId, String username, String configurationName)
UserInvitationService
getRegistrationsForUser
in interface UserInvitationService
protected static boolean isEmailExist(UserRegistrationConfiguration configuration, DocumentModel userRegistration)
public String submitRegistrationRequest(String configurationName, DocumentModel userRegistrationModel, Map<String,Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept)
UserInvitationService
submitRegistrationRequest
in interface UserInvitationService
protected String buildEnterPasswordUrl(UserRegistrationConfiguration configuration)
public void acceptRegistrationRequest(String requestId, Map<String,Serializable> additionnalInfo) throws UserRegistrationException
UserInvitationService
acceptRegistrationRequest
in interface UserInvitationService
UserRegistrationException
public void rejectRegistrationRequest(String requestId, Map<String,Serializable> additionnalInfo) throws UserRegistrationException
UserInvitationService
rejectRegistrationRequest
in interface UserInvitationService
UserRegistrationException
public Map<String,Serializable> validateRegistration(String requestId, Map<String,Serializable> additionnalInfo) throws UserRegistrationException
UserInvitationService
validateRegistration
in interface UserInvitationService
UserRegistrationException
public Map<String,Serializable> validateRegistrationAndSendEmail(String requestId, Map<String,Serializable> additionnalInfo) throws UserRegistrationException
UserInvitationService
validateRegistrationAndSendEmail
in interface UserInvitationService
UserRegistrationException
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
protected InvitationUserFactory getRegistrationUserFactory(UserRegistrationConfiguration configuration)
public NuxeoPrincipal createUser(CoreSession session, DocumentModel registrationDoc) throws UserRegistrationException
createUser
in interface UserInvitationService
UserRegistrationException
public UserRegistrationConfiguration getConfiguration()
getConfiguration
in interface UserInvitationService
public UserRegistrationConfiguration getConfiguration(DocumentModel requestDoc)
getConfiguration
in interface UserInvitationService
public UserRegistrationConfiguration getConfiguration(String name)
UserInvitationService
getConfiguration
in interface UserInvitationService
name
- configuration namepublic RegistrationRules getRegistrationRules(String configurationName)
UserInvitationService
getRegistrationRules
in interface UserInvitationService
public void reviveRegistrationRequests(CoreSession session, List<DocumentModel> registrationDocs)
UserInvitationService
reviveRegistrationRequests
in interface UserInvitationService
protected void reviveRegistrationRequest(CoreSession session, DocumentModel registrationDoc, Map<String,Serializable> additionalInfos)
public void deleteRegistrationRequests(CoreSession session, List<DocumentModel> registrationDocs)
UserInvitationService
deleteRegistrationRequests
in interface UserInvitationService
public Set<String> getConfigurationsName()
UserInvitationService
getConfigurationsName
in interface UserInvitationService
public void checkRequestId(String requestId) throws UserRegistrationException
UserInvitationService
checkRequestId
in interface UserInvitationService
requestId
- The value of the request id.UserRegistrationException
public String getNameEventRegistrationSubmitted()
getNameEventRegistrationSubmitted
in interface UserInvitationService
public String getNameEventRegistrationAccepted()
getNameEventRegistrationAccepted
in interface UserInvitationService
public String getNameEventRegistrationRejected()
getNameEventRegistrationRejected
in interface UserInvitationService
public String getNameEventRegistrationValidated()
getNameEventRegistrationValidated
in interface UserInvitationService
Copyright © 2015 Nuxeo SA. All rights reserved.