Package org.nuxeo.ecm.user.invite
Class UserInvitationComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.user.invite.UserInvitationComponent
- All Implemented Interfaces:
UserInvitationService
,Adaptable
,Component
,Extensible
,TimestampedService
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
protected class
protected class
protected class
protected class
protected class
Nested classes/interfaces inherited from interface org.nuxeo.ecm.user.invite.UserInvitationService
UserInvitationService.ValidationMethod
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
UserRegistrationConfiguration> static final String
static final String
protected String
protected RenderingHelper
protected String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
Fields inherited from interface org.nuxeo.ecm.user.invite.UserInvitationService
REGISTRATION_CONFIGURATION_NAME, REGISTRATION_DATA_DOC, REGISTRATION_DATA_USER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptRegistrationRequest
(String requestId, Map<String, Serializable> additionnalInfo) accept the registration requestprotected String
buildEnterPasswordUrl
(UserRegistrationConfiguration configuration) void
checkRequestId
(String requestId) The method checks if the request id is a valid one.protected boolean
checkUserFromRegistrationExistence
(DocumentModel registrationDoc) createUser
(CoreSession session, DocumentModel registrationDoc) void
deleteRegistrationRequests
(CoreSession session, List<DocumentModel> registrationDocs) Delete a registration documentprotected void
generateMail
(String destination, String copy, String title, String content) getConfiguration
(String name) Return specific configuration for the specified namegetConfiguration
(DocumentModel requestDoc) List all registered onfiguration namegetOrCreateRootDocument
(CoreSession session, String configurationName) getRegistrationRules
(String configurationName) Get registration rules adaptergetRegistrationRulesDocument
(CoreSession session, String configurationName) Get documentmodel that stores request configuration using RegistrationConfiguration facet.getRegistrationsForUser
(String docId, String username, String configurationName) Retrieve registrations for a document givent the usernameprotected InvitationUserFactory
getRegistrationUserFactory
(UserRegistrationConfiguration configuration) protected String
getUserRegistrationModel
(String configurationName) Create a document model for the UserRegistration doctype.protected static boolean
isEmailExist
(UserRegistrationConfiguration configuration, DocumentModel userRegistration) protected static boolean
void
registerContribution
(Object contribution, String extensionPoint, ComponentInstance contributor) void
rejectRegistrationRequest
(String requestId, Map<String, Serializable> additionnalInfo) reject the registration requestprotected 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) submitRegistrationRequest
(String configurationName, DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Stores a resgitration request like submitRegistrationRequest with Document informationsubmitRegistrationRequest
(DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Stores a registration request and return a unique ID for itprotected boolean
userAlreadyExists
(UserRegistrationInfo userRegistrationInfo) validateRegistration
(String requestId, Map<String, Serializable> additionnalInfo) Validate a registration request and generate the target UservalidateRegistrationAndSendEmail
(String requestId, Map<String, Serializable> additionnalInfo) Validate a registration request and generate the target UserMethods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
PARAM_ORIGINATING_USER
- See Also:
-
NUXEO_URL_KEY
- See Also:
-
repoName
-
testRendering
-
rh
-
configurations
-
-
Constructor Details
-
UserInvitationComponent
public UserInvitationComponent()
-
-
Method Details
-
getTestedRendering
-
getTargetRepositoryName
-
userAlreadyExists
-
getUserRegistrationModel
Description copied from interface:UserInvitationService
Create a document model for the UserRegistration doctype.- Specified by:
getUserRegistrationModel
in interfaceUserInvitationService
- Parameters:
configurationName
- The name of the configuration.- Returns:
- The document model
-
getRegistrationRulesDocument
Description copied from interface:UserInvitationService
Get documentmodel that stores request configuration using RegistrationConfiguration facet.- Specified by:
getRegistrationRulesDocument
in interfaceUserInvitationService
-
getOrCreateRootDocument
-
sendEvent
protected EventContext sendEvent(CoreSession session, DocumentModel source, String evName) throws UserRegistrationException - Throws:
UserRegistrationException
-
sendValidationEmail
protected void sendValidationEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc) -
sendEmail
protected void sendEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc, String emailTemplatePath, String emailTitle) -
isTestModeSet
protected static boolean isTestModeSet() -
checkUserFromRegistrationExistence
-
generateMail
protected void generateMail(String destination, String copy, String title, String content) throws javax.mail.MessagingException - Throws:
javax.mail.MessagingException
-
submitRegistrationRequest
public String submitRegistrationRequest(DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Description copied from interface:UserInvitationService
Stores a registration request and return a unique ID for it- Specified by:
submitRegistrationRequest
in interfaceUserInvitationService
-
getRegistrationsForUser
public DocumentModelList getRegistrationsForUser(String docId, String username, String configurationName) Description copied from interface:UserInvitationService
Retrieve registrations for a document givent the username- Specified by:
getRegistrationsForUser
in interfaceUserInvitationService
-
isEmailExist
protected static boolean isEmailExist(UserRegistrationConfiguration configuration, DocumentModel userRegistration) -
submitRegistrationRequest
public String submitRegistrationRequest(String configurationName, DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Description copied from interface:UserInvitationService
Stores a resgitration request like submitRegistrationRequest with Document information- Specified by:
submitRegistrationRequest
in interfaceUserInvitationService
- Returns:
- a unique ID for it
-
buildEnterPasswordUrl
-
acceptRegistrationRequest
public void acceptRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationService
accept the registration request- Specified by:
acceptRegistrationRequest
in interfaceUserInvitationService
- Throws:
UserRegistrationException
-
rejectRegistrationRequest
public void rejectRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationService
reject the registration request- Specified by:
rejectRegistrationRequest
in interfaceUserInvitationService
- Throws:
UserRegistrationException
-
validateRegistration
public Map<String,Serializable> validateRegistration(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationService
Validate a registration request and generate the target User- Specified by:
validateRegistration
in interfaceUserInvitationService
- Throws:
UserRegistrationException
-
validateRegistrationAndSendEmail
public Map<String,Serializable> validateRegistrationAndSendEmail(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationService
Validate a registration request and generate the target User- Specified by:
validateRegistrationAndSendEmail
in interfaceUserInvitationService
- Throws:
UserRegistrationException
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContribution
in classDefaultComponent
-
getRegistrationUserFactory
protected InvitationUserFactory getRegistrationUserFactory(UserRegistrationConfiguration configuration) -
createUser
public NuxeoPrincipal createUser(CoreSession session, DocumentModel registrationDoc) throws UserRegistrationException - Specified by:
createUser
in interfaceUserInvitationService
- Throws:
UserRegistrationException
-
getConfiguration
- Specified by:
getConfiguration
in interfaceUserInvitationService
-
getConfiguration
- Specified by:
getConfiguration
in interfaceUserInvitationService
-
getConfiguration
Description copied from interface:UserInvitationService
Return specific configuration for the specified name- Specified by:
getConfiguration
in interfaceUserInvitationService
- Parameters:
name
- configuration name
-
getRegistrationRules
Description copied from interface:UserInvitationService
Get registration rules adapter- Specified by:
getRegistrationRules
in interfaceUserInvitationService
-
reviveRegistrationRequests
Description copied from interface:UserInvitationService
Send a mail to the invited user to revive his invitation If an error occured while sending an email, it logs it and continue.- Specified by:
reviveRegistrationRequests
in interfaceUserInvitationService
-
reviveRegistrationRequest
protected void reviveRegistrationRequest(CoreSession session, DocumentModel registrationDoc, Map<String, Serializable> additionalInfos) -
deleteRegistrationRequests
Description copied from interface:UserInvitationService
Delete a registration document- Specified by:
deleteRegistrationRequests
in interfaceUserInvitationService
-
getConfigurationsName
Description copied from interface:UserInvitationService
List all registered onfiguration name- Specified by:
getConfigurationsName
in interfaceUserInvitationService
-
checkRequestId
Description copied from interface:UserInvitationService
The method checks if the request id is a valid one.- Specified by:
checkRequestId
in interfaceUserInvitationService
- Parameters:
requestId
- The value of the request id.- Throws:
UserRegistrationException
-
getNameEventRegistrationSubmitted
- Specified by:
getNameEventRegistrationSubmitted
in interfaceUserInvitationService
- Returns:
- The name of the event when the registration is submitted.
-
getNameEventRegistrationAccepted
- Specified by:
getNameEventRegistrationAccepted
in interfaceUserInvitationService
- Returns:
- The name of the event when the registration is accepted.
-
getNameEventRegistrationRejected
- Specified by:
getNameEventRegistrationRejected
in interfaceUserInvitationService
- Returns:
- The name of the event when the registration is rejected.
-
getNameEventRegistrationValidated
- Specified by:
getNameEventRegistrationValidated
in interfaceUserInvitationService
- Returns:
- The name of the event when the registration is validated.
-